summaryrefslogtreecommitdiff
path: root/src/cgame
diff options
context:
space:
mode:
Diffstat (limited to 'src/cgame')
-rw-r--r--src/cgame/cg_draw.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c
index dd86371c..4bcec5b3 100644
--- a/src/cgame/cg_draw.c
+++ b/src/cgame/cg_draw.c
@@ -2123,18 +2123,19 @@ void CG_AddLagometerSnapshotInfo( snapshot_t *snap )
lagometer.snapshotFlags[ lagometer.snapshotCount & ( LAG_SAMPLES - 1 ) ] = snap->snapFlags;
lagometer.snapshotCount++;
- // now used by cg_projectileNudge, so we need to move this where it will get
- // called even if cg_lagometer = 0
cg.ping = 0;
- previousPings[ index++ ] = cg.snap->ping;
- index = index % PING_FRAMES;
-
- for( i = 0; i < PING_FRAMES; i++ )
+ if( cg.snap )
{
- cg.ping += previousPings[ i ];
- }
+ previousPings[ index++ ] = cg.snap->ping;
+ index = index % PING_FRAMES;
- cg.ping /= PING_FRAMES;
+ for( i = 0; i < PING_FRAMES; i++ )
+ {
+ cg.ping += previousPings[ i ];
+ }
+
+ cg.ping /= PING_FRAMES;
+ }
}
/*