summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
Diffstat (limited to 'src/game')
-rw-r--r--src/game/bg_pmove.c17
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