summaryrefslogtreecommitdiff
path: root/src/cgame/cg_snapshot.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cgame/cg_snapshot.c')
-rw-r--r--src/cgame/cg_snapshot.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/cgame/cg_snapshot.c b/src/cgame/cg_snapshot.c
index fdee86eb..d172803f 100644
--- a/src/cgame/cg_snapshot.c
+++ b/src/cgame/cg_snapshot.c
@@ -37,9 +37,11 @@ CG_ResetEntity
==================
*/
static void CG_ResetEntity( centity_t *cent ) {
- // if an event is set, assume it is new enough to use
- // if the event had timed out, it would have been cleared
- cent->previousEvent = 0;
+ // if the previous snapshot this entity was updated in is at least
+ // an event window back in time then we can reset the previous event
+ if ( cent->snapShotTime < cg.time - EVENT_VALID_MSEC ) {
+ cent->previousEvent = 0;
+ }
cent->trailTime = cg.snap->serverTime;
@@ -162,6 +164,9 @@ static void CG_TransitionSnapshot( void ) {
for ( i = 0 ; i < cg.snap->numEntities ; i++ ) {
cent = &cg_entities[ cg.snap->entities[ i ].number ];
CG_TransitionEntity( cent );
+
+ // remember time of snapshot this entity was last updated in
+ cent->snapShotTime = cg.snap->serverTime;
}
cg.nextSnap = NULL;