git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6825
d7cf8633-e32d-0410-b094-
e92efae38249
// update the stairoffset if the player entity has gone up or down without leaving the ground
//Con_Printf("cl.onground %i oldz %f newz %f vel %f %f %f\n", cl.onground, oldz, vieworg[2], cl.movement_velocity[0], cl.movement_velocity[1], cl.movement_velocity[2]);
// update the stairoffset if the player entity has gone up or down without leaving the ground
//Con_Printf("cl.onground %i oldz %f newz %f vel %f %f %f\n", cl.onground, oldz, vieworg[2], cl.movement_velocity[0], cl.movement_velocity[1], cl.movement_velocity[2]);
- cl.stairoffset -= vieworg[2] - oldz;
+ if (cl.onground)
+ {
+ cl.stairoffset -= vieworg[2] - oldz;
+ cl.stairoffset = bound(-16, cl.stairoffset, 16);
+ }
+ else
+ cl.stairoffset = 0;
- cl.stairoffset = bound(-16, cl.stairoffset, 16);