var float autocvar_cl_movement_errorcompensation = 0;
// engine stuff
-.float pmove_flags;
-float pmove_onground; // weird engine flag we shouldn't really use but have to for now
-#define PMF_JUMP_HELD 1
-#define PMF_DUCKED 4
-#define PMF_ONGROUND 8
#define REFDEFFLAG_TELEPORTED 1
#define REFDEFFLAG_JUMPING 2
+float pmove_onground; // weird engine flag we shouldn't really use but have to for now
-entity csqcplayer;
vector csqcplayer_origin, csqcplayer_velocity;
float csqcplayer_sequence, player_pmflags;
float csqcplayer_moveframe;
csqcplayer_status = CSQCPLAYERSTATUS_PREDICTED;
- // FIXME do we really NEED this? dead players have servercommandframe
- // == 0 and thus won't predict
+#if 0
+ // we don't need this
+ // darkplaces makes servercommandframe == 0 in these cases anyway
if (getstatf(STAT_HEALTH) <= 0)
{
csqcplayer_moveframe = clientcommandframe;
print("the Weird code path got hit\n");
return;
}
+#endif
if(csqcplayer_moveframe >= endframe)
{
}
else
{
+ float flg = self.iflags;
+ self.iflags &~= IFLAG_ORIGIN | IFLAG_ANGLES;
+ InterpolateOrigin_Do();
+ self.iflags = flg;
+
if(csqcplayer_status == CSQCPLAYERSTATUS_FROMSERVER)
{
vector o, v;
}
CSQCPlayer_PredictTo(clientcommandframe + 1, TRUE);
+#ifdef CSQCMODEL_SERVERSIDE_CROUCH
+ // get crouch state from the server (LAG)
+ if(getstati(STAT_VIEWHEIGHT) == PL_VIEW_OFS_z)
+ self.pmove_flags &~= PMF_DUCKED;
+ else if(getstati(STAT_VIEWHEIGHT) == PL_CROUCH_VIEW_OFS_z)
+ self.pmove_flags |= PMF_DUCKED;
+#endif
+
CSQCPlayer_SetMinsMaxs();
self.angles_y = input_angles_y;