]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/csqcmodellib/cl_player.qc
Fix compilation with gmqcc.
[xonotic/xonotic-data.pk3dir.git] / qcsrc / csqcmodellib / cl_player.qc
index 4aa8fdf92cdb89886784437e1ba471ca5b8b0d49..46c312f160ec8e333bd566897cf37aabc559affd 100644 (file)
 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
 
 vector csqcplayer_origin, csqcplayer_velocity;
 float csqcplayer_sequence, player_pmflags;
@@ -197,7 +193,7 @@ void CSQCPlayer_SetCamera()
 
                        // get crouch state from the server
                        if(getstati(STAT_VIEWHEIGHT) == PL_VIEW_OFS_z)
-                               self.pmove_flags &~= PMF_DUCKED;
+                               self.pmove_flags &= ~PMF_DUCKED;
                        else if(getstati(STAT_VIEWHEIGHT) == PL_CROUCH_VIEW_OFS_z)
                                self.pmove_flags |= PMF_DUCKED;
 
@@ -205,7 +201,7 @@ void CSQCPlayer_SetCamera()
                        if(pmove_onground)
                                self.pmove_flags |= PMF_ONGROUND;
                        else
-                               self.pmove_flags &~= PMF_ONGROUND;
+                               self.pmove_flags &= ~PMF_ONGROUND;
 
                        CSQCPlayer_SetMinsMaxs();
 
@@ -217,6 +213,11 @@ void CSQCPlayer_SetCamera()
                }
                else
                {
+                       float flg = self.iflags;
+                       self.iflags &= ~(IFLAG_ORIGIN | IFLAG_ANGLES);
+                       InterpolateOrigin_Do();
+                       self.iflags = flg;
+
                        if(csqcplayer_status == CSQCPLAYERSTATUS_FROMSERVER)
                        {
                                vector o, v;
@@ -230,7 +231,7 @@ void CSQCPlayer_SetCamera()
 
                                // get crouch state from the server
                                if(getstati(STAT_VIEWHEIGHT) == PL_VIEW_OFS_z)
-                                       self.pmove_flags &~= PMF_DUCKED;
+                                       self.pmove_flags &= ~PMF_DUCKED;
                                else if(getstati(STAT_VIEWHEIGHT) == PL_CROUCH_VIEW_OFS_z)
                                        self.pmove_flags |= PMF_DUCKED;
 
@@ -238,12 +239,20 @@ void CSQCPlayer_SetCamera()
                                if(pmove_onground)
                                        self.pmove_flags |= PMF_ONGROUND;
                                else
-                                       self.pmove_flags &~= PMF_ONGROUND;
+                                       self.pmove_flags &= ~PMF_ONGROUND;
 
                                CSQCPlayer_SavePrediction();
                        }
                        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;