diff options
author | Tony J. White <tjw@tjw.org> | 2006-12-27 16:53:46 +0000 |
---|---|---|
committer | Tony J. White <tjw@tjw.org> | 2006-12-27 16:53:46 +0000 |
commit | 7d6b09da70eea6cb76762129c01c13ee08bbbf9b (patch) | |
tree | 4fcadc970e59593d89ff258ac42f71136957f33c | |
parent | 9799a8bcd56946b076a164121f076a7bb0ea5ec0 (diff) |
* (bug 2937) fixed crash from cg_projectileNudge patch when using vm_cgame 0
-rw-r--r-- | src/cgame/cg_draw.c | 19 |
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; + } } /* |