]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix some minor issues with crouching and looking up/down
authorMario <zacjardine@y7mail.com>
Tue, 5 May 2015 13:11:25 +0000 (23:11 +1000)
committerMario <zacjardine@y7mail.com>
Tue, 5 May 2015 13:11:25 +0000 (23:11 +1000)
qcsrc/common/physics.qc
qcsrc/csqcmodellib/cl_player.qc
qcsrc/server/cl_client.qc

index 32ae72f4294591bdf7a10b88a94ae046732c7b17..0e14da74932bb38e1d47e0bd08895aa4994140a5 100644 (file)
@@ -1581,6 +1581,8 @@ void PM_Main()
 
        self.movement = PHYS_INPUT_MOVEVALUES(self);
 
+       vector oldv_angle = self.v_angle;
+       vector oldangles = self.angles; // we need to save these as they're abused by other code
        self.v_angle = PHYS_INPUT_ANGLES(self);
        self.angles = PHYS_WORLD_ANGLES(self);
 
@@ -1818,6 +1820,11 @@ void PM_Main()
        self.lastflags = self.flags;
 
        self.lastclassname = self.classname;
+
+#ifdef CSQC
+       self.v_angle = oldv_angle;
+       self.angles = oldangles;
+#endif
 }
 
 #ifdef SVQC
index 76ee4124a121694d546add07d16c7b446e30090e..12ffe5b2f18b83c3ecb88598677cb0fe7e5c0666 100644 (file)
@@ -189,7 +189,7 @@ void CSQCPlayer_PredictTo(float endframe, float apply_error)
        input_angles = view_angles;
 }
 
-float CSQCPlayer_IsLocalPlayer()
+bool CSQCPlayer_IsLocalPlayer()
 {
        return (self == csqcplayer);
 }
index ee8520ca774ca9eca5b33a9aaa5a0f4ab9bd0199..d3bb7362e9004baffa6d488714e59defc0109aa0 100644 (file)
@@ -2448,8 +2448,8 @@ void PlayerPreThink (void)
                        if (!self.crouch)
                        {
                                self.crouch = true;
-                               self.view_ofs = PL_CROUCH_VIEW_OFS;
-                               setsize (self, PL_CROUCH_MIN, PL_CROUCH_MAX);
+                               self.view_ofs = self.stat_pl_crouch_view_ofs;
+                               setsize (self, self.stat_pl_crouch_min, self.stat_pl_crouch_max);
                                // setanim(self, self.anim_duck, false, true, true); // this anim is BROKEN anyway
                        }
                }
@@ -2457,12 +2457,12 @@ void PlayerPreThink (void)
                {
                        if (self.crouch)
                        {
-                               tracebox(self.origin, PL_MIN, PL_MAX, self.origin, false, self);
+                               tracebox(self.origin, self.stat_pl_min, self.stat_pl_max, self.origin, false, self);
                                if (!trace_startsolid)
                                {
                                        self.crouch = false;
-                                       self.view_ofs = PL_VIEW_OFS;
-                                       setsize (self, PL_MIN, PL_MAX);
+                                       self.view_ofs = self.stat_pl_view_ofs;
+                                       setsize (self, self.stat_pl_min, self.stat_pl_max);
                                }
                        }
                }