summaryrefslogtreecommitdiff
path: root/src/cgame/cg_players.c
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2005-06-05 22:16:54 +0000
committerTim Angus <tim@ngus.net>2005-06-05 22:16:54 +0000
commitfb6006e34c1fe83acfb7976e50cb2f498e9c70b6 (patch)
treeb8b3f26b52c3b2e71b51d40ff84e86b5bfb9d52d /src/cgame/cg_players.c
parent47221c9c78f4a027211a041eb2ad527339b4d54b (diff)
* Added flashing alien icon if already at maximum class
* Improved scanner render and refactored scanner code * Added animated projectiles * Grenade * Changed model names to be human name agnostic * Added sounds for lev1 grab and lev4 charge * Added sound for failed evolution * Added battery pack rendering code * Added functionality to particle system to allow attachment of particle systems to particles (for nice explosions) * Implemented CG_FileExists * Added some code to gracefully handle missing sounds (easier than making the sounds :D) * cg_drawBBOX now draws player BBOXen * Renamed the alien classes (now done in class override scripts) * Implemented Vector4Add * The usual assorted bug fixes
Diffstat (limited to 'src/cgame/cg_players.c')
-rw-r--r--src/cgame/cg_players.c57
1 files changed, 54 insertions, 3 deletions
diff --git a/src/cgame/cg_players.c b/src/cgame/cg_players.c
index 2a1ca0f4..0dadbb8f 100644
--- a/src/cgame/cg_players.c
+++ b/src/cgame/cg_players.c
@@ -557,9 +557,33 @@ static void CG_LoadClientInfo( clientInfo_t *ci )
if( !s )
break;
- ci->sounds[ i ] = trap_S_RegisterSound( va( "sound/player/%s/%s", dir, s + 1 ), qfalse );
- if( !ci->sounds[ i ] )
- ci->sounds[ i ] = trap_S_RegisterSound( va( "sound/player/%s/%s", fallback, s + 1 ), qfalse );
+ // fanny about a bit with sounds that are missing
+ if( !CG_FileExists( va( "sound/player/%s/%s", dir, s + 1 ) ) )
+ {
+ //file doesn't exist
+
+ if( i == 11 || i == 8 ) //fall or falling
+ {
+ ci->sounds[ i ] = trap_S_RegisterSound( "sound/null.wav", qfalse );
+ }
+ else
+ {
+ if( i == 9 ) //gasp
+ s = cg_customSoundNames[ 7 ]; //pain100_1
+ else if( i == 10 ) //drown
+ s = cg_customSoundNames[ 0 ]; //death1
+
+ ci->sounds[ i ] = trap_S_RegisterSound( va( "sound/player/%s/%s", dir, s + 1 ), qfalse );
+ if( !ci->sounds[ i ] )
+ ci->sounds[ i ] = trap_S_RegisterSound( va( "sound/player/%s/%s", fallback, s + 1 ), qfalse );
+ }
+ }
+ else
+ {
+ ci->sounds[ i ] = trap_S_RegisterSound( va( "sound/player/%s/%s", dir, s + 1 ), qfalse );
+ if( !ci->sounds[ i ] )
+ ci->sounds[ i ] = trap_S_RegisterSound( va( "sound/player/%s/%s", fallback, s + 1 ), qfalse );
+ }
}
if( ci->footsteps == FOOTSTEP_CUSTOM )
@@ -1526,6 +1550,7 @@ static void CG_PlayerUpgrades( centity_t *cent, refEntity_t *torso )
{
int held, active;
refEntity_t jetpack;
+ refEntity_t battpack;
refEntity_t flash;
entityState_t *es = &cent->currentState;
@@ -1627,6 +1652,24 @@ static void CG_PlayerUpgrades( centity_t *cent, refEntity_t *torso )
cent->jetPackState = JPS_OFF;
}
+ if( held & ( 1 << UP_BATTPACK ) )
+ {
+ memset( &battpack, 0, sizeof( battpack ) );
+ VectorCopy( torso->lightingOrigin, battpack.lightingOrigin );
+ battpack.shadowPlane = torso->shadowPlane;
+ battpack.renderfx = torso->renderfx;
+
+ battpack.hModel = cgs.media.battpackModel;
+
+ //identity matrix
+ AxisCopy( axisDefault, battpack.axis );
+
+ //FIXME: change to tag_back when it exists
+ CG_PositionRotatedEntityOnTag( &battpack, torso, torso->hModel, "tag_head" );
+
+ trap_R_AddRefEntityToScene( &battpack );
+ }
+
if( es->eFlags & EF_BLOBLOCKED )
{
vec3_t temp, origin, up = { 0.0f, 0.0f, 1.0f };
@@ -2044,6 +2087,14 @@ void CG_Player( centity_t *cent )
return;
}
+ if( cg_drawBBOX.integer )
+ {
+ vec3_t mins, maxs;
+
+ BG_FindBBoxForClass( class, mins, maxs, NULL, NULL, NULL );
+ CG_DrawBoundingBox( cent->lerpOrigin, mins, maxs );
+ }
+
memset( &legs, 0, sizeof( legs ) );
memset( &torso, 0, sizeof( torso ) );
memset( &head, 0, sizeof( head ) );