VectorScale(scale, 1000000, scale);
// calculate current view matrix
- V_CalcRefdef();
+ //V_CalcRefdef();
VectorClear(temp);
Matrix4x4_Transform(&r_view.matrix, temp, cl.cmd.cursor_start);
VectorSet(temp, cl.cmd.cursor_screen[2] * scale[2], cl.cmd.cursor_screen[0] * scale[0], cl.cmd.cursor_screen[1] * scale[1]);
// get the first movement queue entry to know whether to crouch and such
s.q = cl.movement_queue[0];
}
+
// store replay location
CL_ClientMovement_UpdateStatus(&s);
- cl.onground = s.onground;
cl.movement_time[1] = cl.movement_time[0];
cl.movement_time[0] = cl.movement_queue[cl.movement_numqueue-1].time;
VectorCopy(cl.movement_origin, cl.movement_oldorigin);
VectorCopy(s.velocity, cl.movement_velocity);
//VectorCopy(s.origin, cl.entities[cl.playerentity].state_current.origin);
//VectorSet(cl.entities[cl.playerentity].state_current.angles, 0, cl.viewangles[1], 0);
+
+ // update the onground flag if appropriate
+ // when not predicted, cl.onground is only cleared by cl_parse.c, but can
+ // be set forcefully here to hide server inconsistencies in the onground
+ // flag (such as when stepping up stairs, the onground flag tends to turn
+ // off briefly due to precision errors, particularly at high framerates),
+ // such inconsistencies can mess up the gun bobbing and stair smoothing,
+ // so they must be avoided.
+ if (cl.movement_predicted)
+ cl.onground = s.onground;
+ else if (s.onground)
+ cl.onground = true;
+
+ // react to onground state changes (for gun bob)
+ if (cl.onground)
+ {
+ if (!cl.oldonground)
+ cl.hitgroundtime = cl.time;
+ cl.lastongroundtime = cl.time;
+ }
+ cl.oldonground = cl.onground;
}
void QW_MSG_WriteDeltaUsercmd(sizebuf_t *buf, qw_usercmd_t *from, qw_usercmd_t *to)
cl.stats[STAT_ITEMS] = MSG_ReadLong ();
cl.onground = (bits & SU_ONGROUND) != 0;
- csqc_onground = cl.onground; //[515]: cause without this csqc will receive not right value on svc_print =/
cl.inwater = (bits & SU_INWATER) != 0;
if (cls.protocol == PROTOCOL_DARKPLACES5)
cl.mtime[1] = cl.mtime[0];
cl.mtime[0] = realtime; // qw has no clock
cl.movement_needupdate = true;
+ cl.onground = false; // since there's no clientdata parsing, clear the onground flag here
// if true the cl.viewangles are interpolated from cl.mviewangles[]
// during this frame
// (makes spectating players much smoother and prevents mouse movement from turning)