diff options
author | Christopher Schwarz <lakitu7@gmail.com> | 2009-10-03 12:33:45 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-03 00:16:04 +0000 |
commit | 6f893383847667c5187ccc0a15ea642c841b4b90 (patch) | |
tree | 81c594f6c4282c8fdd237042055389e0023a5b8c /src/game | |
parent | 92aad04b4702d8237cb363e0f28daa66f9adc123 (diff) |
* Slight cleanup and futureproofing of r1164 (Timbo)
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/bg_pmove.c | 17 |
1 files changed, 14 insertions, 3 deletions
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 |