]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Set the client's view_angles to the physics .v_angle, fixes aiming in side-scrolling...
authorMario <mario@smbclan.net>
Thu, 14 Apr 2016 12:09:12 +0000 (22:09 +1000)
committerMario <mario@smbclan.net>
Thu, 14 Apr 2016 12:24:10 +0000 (22:24 +1000)
qcsrc/common/physics/player.qc
qcsrc/lib/csqcmodel/cl_player.qc

index 0ecfa180f45bc143e6d11c831bdbbc41bc0a7b60..541e9d61e0819c1baa38047ae4ff39d142467a51 100644 (file)
@@ -596,7 +596,7 @@ void CheckPlayerJump(entity this)
        {
                float air_jump = !PlayerJump(this) || player_multijump; // PlayerJump() has important side effects
                float activate = JETPACK_JUMP(this) && air_jump && PHYS_INPUT_BUTTON_JUMP(this) || PHYS_INPUT_BUTTON_JETPACK(this);
-               float has_fuel = !PHYS_JETPACK_FUEL(this) || PHYS_AMMO_FUEL(this) || ITEMS_STAT(this) & IT_UNLIMITED_WEAPON_AMMO;
+               float has_fuel = !PHYS_JETPACK_FUEL(this) || PHYS_AMMO_FUEL(this) || (ITEMS_STAT(this) & IT_UNLIMITED_WEAPON_AMMO);
 
                if (!(ITEMS_STAT(this) & ITEM_Jetpack.m_itemid)) { }
                else if (this.jetpack_stopped) { }
@@ -1309,11 +1309,6 @@ void PM_Main(entity this)
 
        this.spectatorspeed = STAT(SPECTATORSPEED);
 
-       vector oldv_angle = this.v_angle;
-       vector oldangles = this.angles; // we need to save these, as they're abused by other code
-       this.v_angle = PHYS_INPUT_ANGLES(this);
-       this.angles = PHYS_WORLD_ANGLES(this);
-
        this.team = myteam + 1; // is this correct?
        if (!(PHYS_INPUT_BUTTON_JUMP(this))) // !jump
                UNSET_JUMP_HELD(this); // canjump = true
@@ -1396,7 +1391,7 @@ void PM_Main(entity this)
                return;
 
        // when we get here, disableclientprediction cannot be 2
-       this.disableclientprediction = 0;
+       this.disableclientprediction = -1;
 #endif
 
        viewloc_PlayerPhysics(this);
@@ -1553,11 +1548,6 @@ LABEL(end)
        this.lastflags = this.flags;
 
        this.lastclassname = this.classname;
-
-#ifdef CSQC
-       this.v_angle = oldv_angle;
-       this.angles = oldangles;
-#endif
 }
 
 #if defined(SVQC)
index 4e308ee56a922005761017ae300772a8a69e15da..13fb92749386f7ce5e6806e20879bce88e14ed59 100644 (file)
@@ -164,6 +164,11 @@ void CSQCPlayer_Physics(entity this)
                if(autocvar_cl_movement == 1)
                        CSQCPlayer_CheckWater(this); // we apparently need to check water *before* physics so it can use this for water jump
 
+               vector oldv_angle = this.v_angle;
+               vector oldangles = this.angles; // we need to save these, as they're abused by other code
+               this.v_angle = PHYS_INPUT_ANGLES(this);
+               this.angles = PHYS_WORLD_ANGLES(this);
+
                CSQC_ClientMovement_PlayerMove_Frame(this);
 
                if(autocvar_cl_movement == 1)
@@ -180,6 +185,11 @@ void CSQCPlayer_Physics(entity this)
                        Movetype_Physics_Spam(this);
                }
 
+               view_angles = this.v_angle;
+               input_angles = this.angles;
+               this.v_angle = oldv_angle;
+               this.angles = oldangles;
+
                this.pmove_flags =
                                ((this.flags & FL_DUCKED) ? PMF_DUCKED : 0) |
                                (!(this.flags & FL_JUMPRELEASED) ? PMF_JUMP_HELD : 0) |