From 046697c4b9369c02e730f1e16617e09876619864 Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Sun, 27 Nov 2005 00:00:16 +0000 Subject: * Fixed death by poison MOD s/antitox/medkit/ * Fixed Marauders momentarily disappearing when wall jumping * Fixed a potential crash bug involving the use of generic1 * Fixed being able to build multiple coincident repeaters if there is no reactor * Fixed incorrect message when invoking "buy ammo" with an energy weapon and no reactor present * Fixed invoking "reload" during a weapon reload causing an unnecessary reload * Fixed aliens having the wrong blood colour when shot with a las gun * Fixed hovel causing invisible builders --- src/cgame/cg_event.c | 3 +-- src/cgame/cg_local.h | 2 +- src/cgame/cg_players.c | 15 ++++++++++----- src/cgame/cg_trails.c | 9 ++++++--- src/cgame/cg_view.c | 6 +++--- src/cgame/cg_weapons.c | 15 +++++++++++++++ 6 files changed, 36 insertions(+), 14 deletions(-) (limited to 'src/cgame') diff --git a/src/cgame/cg_event.c b/src/cgame/cg_event.c index 459d45f2..f2d64601 100644 --- a/src/cgame/cg_event.c +++ b/src/cgame/cg_event.c @@ -293,7 +293,7 @@ static void CG_Obituary( entityState_t *ent ) break; case MOD_POISON: - message = "should have used antitox against"; + message = "should have used a medkit against"; message2 = "'s poison"; break; case MOD_LEVEL1_PCLOUD: @@ -840,7 +840,6 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) DEBUGNAME( "EV_BUILD_DELAY" ); if( clientNum == cg.predictedPlayerState.clientNum ) { - //FIXME: change to "negative" sound trap_S_StartLocalSound( cgs.media.buildableRepairedSound, CHAN_LOCAL_SOUND ); cg.lastBuildAttempt = cg.time; } diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index 908cd1b3..f1bc15d6 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -694,7 +694,7 @@ typedef struct qboolean infoValid; char name[ MAX_QPATH ]; - team_t team; + pTeam_t team; int botSkill; // 0 = not bot, 1-5 = bot diff --git a/src/cgame/cg_players.c b/src/cgame/cg_players.c index d1a361d8..fd186145 100644 --- a/src/cgame/cg_players.c +++ b/src/cgame/cg_players.c @@ -1351,7 +1351,9 @@ static void CG_PlayerWWSmoothing( centity_t *cent, vec3_t in[ 3 ], vec3_t out[ 3 vec3_t inAxis[ 3 ], lastAxis[ 3 ], outAxis[ 3 ]; //set surfNormal - if( !( es->eFlags & EF_WALLCLIMBCEILING ) ) + if( !(es->eFlags & EF_WALLCLIMB ) ) + VectorCopy( refNormal, surfNormal ); + else if( !( es->eFlags & EF_WALLCLIMBCEILING ) ) VectorCopy( es->angles2, surfNormal ); else VectorCopy( ceilingNormal, surfNormal ); @@ -2274,10 +2276,13 @@ void CG_Player( centity_t *cent ) // // add the gun / barrel / flash // - if( !ci->nonsegmented ) - CG_AddPlayerWeapon( &torso, NULL, cent ); - else - CG_AddPlayerWeapon( &legs, NULL, cent ); + if( es->weapon != WP_NONE ) + { + if( !ci->nonsegmented ) + CG_AddPlayerWeapon( &torso, NULL, cent ); + else + CG_AddPlayerWeapon( &legs, NULL, cent ); + } CG_PlayerUpgrades( cent, &torso ); diff --git a/src/cgame/cg_trails.c b/src/cgame/cg_trails.c index c745b2bb..3ef19f00 100644 --- a/src/cgame/cg_trails.c +++ b/src/cgame/cg_trails.c @@ -637,10 +637,13 @@ static void CG_UpdateBeam( trailBeam_t *tb ) } } - if( !CG_AttachmentPoint( &ts->frontAttachment, tb->nodes->refPosition ) ) - CG_DestroyTrailSystem( &ts ); + if( tb->nodes ) + { + if( !CG_AttachmentPoint( &ts->frontAttachment, tb->nodes->refPosition ) ) + CG_DestroyTrailSystem( &ts ); - VectorCopy( tb->nodes->refPosition, tb->nodes->position ); + VectorCopy( tb->nodes->refPosition, tb->nodes->position ); + } } CG_ApplyJitters( tb ); diff --git a/src/cgame/cg_view.c b/src/cgame/cg_view.c index 89a072ab..95c0de7b 100644 --- a/src/cgame/cg_view.c +++ b/src/cgame/cg_view.c @@ -286,8 +286,8 @@ static void CG_OffsetThirdPersonView( void ) // if dead, look at killer if( cg.predictedPlayerState.stats[ STAT_HEALTH ] <= 0 ) { - focusAngles[ YAW ] = cg.predictedPlayerState.generic1; - cg.refdefViewAngles[ YAW ] = cg.predictedPlayerState.generic1; + focusAngles[ YAW ] = cg.predictedPlayerState.stats[ STAT_VIEWLOCK ]; + cg.refdefViewAngles[ YAW ] = cg.predictedPlayerState.stats[ STAT_VIEWLOCK ]; } //if ( focusAngles[PITCH] > 45 ) { @@ -430,7 +430,7 @@ static void CG_OffsetFirstPersonView( void ) { angles[ ROLL ] = 40; angles[ PITCH ] = -15; - angles[ YAW ] = cg.snap->ps.generic1; + angles[ YAW ] = cg.snap->ps.stats[ STAT_VIEWLOCK ]; origin[ 2 ] += cg.predictedPlayerState.viewheight; return; } diff --git a/src/cgame/cg_weapons.c b/src/cgame/cg_weapons.c index f47f75ab..7297c518 100644 --- a/src/cgame/cg_weapons.c +++ b/src/cgame/cg_weapons.c @@ -787,6 +787,9 @@ void CG_AddPlayerWeapon( refEntity_t *parent, playerState_t *ps, centity_t *cent weaponNum = cent->currentState.weapon; weaponMode = cent->currentState.generic1; + if( weaponMode <= WPM_NONE || weaponMode >= WPM_NUM_WEAPONMODES ) + weaponMode = WPM_PRIMARY; + if( ( ( cent->currentState.eFlags & EF_FIRING ) && weaponMode == WPM_PRIMARY ) || ( ( cent->currentState.eFlags & EF_FIRING2 ) && weaponMode == WPM_SECONDARY ) || ( ( cent->currentState.eFlags & EF_FIRING3 ) && weaponMode == WPM_TERTIARY ) ) @@ -970,6 +973,9 @@ void CG_AddViewWeapon( playerState_t *ps ) weapon_t weapon = ps->weapon; weaponMode_t weaponMode = ps->generic1; + if( weaponMode <= WPM_NONE || weaponMode >= WPM_NUM_WEAPONMODES ) + weaponMode = WPM_PRIMARY; + CG_RegisterWeapon( weapon ); wi = &cg_weapons[ weapon ]; cent = &cg.predictedPlayerEntity; // &cg_entities[cg.snap->ps.clientNum]; @@ -1432,6 +1438,9 @@ void CG_FireWeapon( centity_t *cent, weaponMode_t weaponMode ) if( weaponNum == WP_NONE ) return; + if( weaponMode <= WPM_NONE || weaponMode >= WPM_NUM_WEAPONMODES ) + weaponMode = WPM_PRIMARY; + if( weaponNum >= WP_NUM_WEAPONS ) { CG_Error( "CG_FireWeapon: ent->weapon >= WP_NUM_WEAPONS" ); @@ -1483,6 +1492,9 @@ void CG_MissileHitWall( weapon_t weaponNum, weaponMode_t weaponMode, int clientN float radius = 1.0f; weaponInfo_t *weapon = &cg_weapons[ weaponNum ]; + if( weaponMode <= WPM_NONE || weaponMode >= WPM_NUM_WEAPONMODES ) + weaponMode = WPM_PRIMARY; + mark = weapon->wim[ weaponMode ].impactMark; radius = weapon->wim[ weaponMode ].impactMarkSize; ps = weapon->wim[ weaponMode ].impactParticleSystem; @@ -1557,6 +1569,9 @@ void CG_MissileHitPlayer( weapon_t weaponNum, weaponMode_t weaponMode, CG_Bleed( origin, normal, entityNum ); + if( weaponMode <= WPM_NONE || weaponMode >= WPM_NUM_WEAPONMODES ) + weaponMode = WPM_PRIMARY; + if( weapon->wim[ weaponMode ].alwaysImpact ) CG_MissileHitWall( weaponNum, weaponMode, 0, origin, dir, IMPACTSOUND_FLESH ); } -- cgit