From 6f893383847667c5187ccc0a15ea642c841b4b90 Mon Sep 17 00:00:00 2001 From: Christopher Schwarz Date: Sat, 3 Oct 2009 12:33:45 +0000 Subject: * Slight cleanup and futureproofing of r1164 (Timbo) --- src/game/bg_pmove.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'src/game') diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c index 52afe2b2..5ac711ad 100644 --- a/src/game/bg_pmove.c +++ b/src/game/bg_pmove.c @@ -3495,11 +3495,22 @@ void PM_UpdateViewAngles( playerState_t *ps, const usercmd_t *cmd ) // circularly clamp the angles with deltas for( i = 0; i < 3; i++ ) { - if( i != ROLL ) - temp[ i ] = cmd->angles[ i ] + ps->delta_angles[ i ]; - else // currently, nothing can roll + if( i == ROLL ) + { + // Guard against speed hack temp[ i ] = ps->delta_angles[ i ]; +#ifdef CGAME + // Assert here so that if cmd->angles[ i ] becomes non-zero + // for a legitimate reason we can tell where and why it's + // being ignored + assert( cmd->angles[ i ] == 0 ); +#endif + + } + else + temp[ i ] = cmd->angles[ i ] + ps->delta_angles[ i ]; + if( i == PITCH ) { // don't let the player look up or down more than 90 degrees -- cgit