summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoman Tetelman <kevlarman@gmail.com>2009-10-03 12:17:52 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:15:50 +0000
commitbc76c88cd1ae898ed8d224fd70b0d3f797b71745 (patch)
tree9a7f364867113f3d25c2cd755540582cf34a250d /src
parent0244441adde816d896eb05034b48202bc19e19dd (diff)
* fix for location not updating while following a player (reported by megatog615)
* dead buildables no longer bleed
Diffstat (limited to 'src')
-rw-r--r--src/cgame/cg_draw.c2
-rw-r--r--src/cgame/cg_local.h2
-rw-r--r--src/cgame/cg_players.c4
-rw-r--r--src/game/g_weapon.c7
4 files changed, 11 insertions, 4 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c
index f97bf9b6..0eab8bef 100644
--- a/src/cgame/cg_draw.c
+++ b/src/cgame/cg_draw.c
@@ -2261,7 +2261,7 @@ static void CG_DrawLocation( rectDef_t *rect, float scale, int textalign, vec4_t
float tx = rect->x, ty = rect->y;
maxX = rect->x + rect->w;
- locent = CG_GetLocation( &cg_entities[ cg.clientNum ] );
+ locent = CG_GetPlayerLocation( );
if( locent )
location = CG_ConfigString( CS_LOCATIONS + locent->currentState.generic1 );
else
diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h
index 0169ff77..cb638702 100644
--- a/src/cgame/cg_local.h
+++ b/src/cgame/cg_local.h
@@ -1663,7 +1663,7 @@ void CG_PrecacheClientInfo( class_t class, char *model, char *skin );
sfxHandle_t CG_CustomSound( int clientNum, const char *soundName );
void CG_PlayerDisconnect( vec3_t org );
void CG_Bleed( vec3_t origin, vec3_t normal, int entityNum );
-centity_t *CG_GetLocation( centity_t *cent );
+centity_t *CG_GetPlayerLocation( void );
//
// cg_buildable.c
diff --git a/src/cgame/cg_players.c b/src/cgame/cg_players.c
index 8bd0457c..bd53eb20 100644
--- a/src/cgame/cg_players.c
+++ b/src/cgame/cg_players.c
@@ -2370,7 +2370,7 @@ void CG_PlayerDisconnect( vec3_t org )
}
}
-centity_t *CG_GetLocation( centity_t *cent )
+centity_t *CG_GetPlayerLocation( void )
{
centity_t *eloc, *best;
float bestlen, len;
@@ -2379,7 +2379,7 @@ centity_t *CG_GetLocation( centity_t *cent )
best = NULL;
bestlen = 3.0f * 8192.0f * 8192.0f;
- VectorCopy( cent->lerpOrigin, origin );
+ VectorCopy( cg.predictedPlayerState.origin, origin );
for( eloc = cg.locationHead; eloc; eloc = eloc->nextLocation )
{
diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c
index beb91429..20666b50 100644
--- a/src/game/g_weapon.c
+++ b/src/game/g_weapon.c
@@ -247,6 +247,10 @@ static void BloodSpurt( gentity_t *attacker, gentity_t *victim, trace_t *tr )
if( !attacker->client )
return;
+
+ if( victim->health <= 0 )
+ return;
+
tent = G_TempEntity( tr->endpos, EV_MISSILE_HIT );
tent->s.otherEntityNum = victim->s.number;
tent->s.eventParm = DirToByte( tr->plane.normal );
@@ -270,6 +274,9 @@ static void WideBloodSpurt( gentity_t *attacker, gentity_t *victim, trace_t *tr
if( !attacker->client )
return;
+ if( victim->health <= 0 )
+ return;
+
if( tr )
VectorSubtract( tr->endpos, victim->s.origin, normal );
else