From: Mario Date: Thu, 14 Apr 2016 12:09:12 +0000 (+1000) Subject: Set the client's view_angles to the physics .v_angle, fixes aiming in side-scrolling... X-Git-Tag: xonotic-v0.8.2~957^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=33a33107917bb95973c39ce39e7727b499412cd5;p=xonotic%2Fxonotic-data.pk3dir.git Set the client's view_angles to the physics .v_angle, fixes aiming in side-scrolling mode, but may introduce some single frame glitches (needs testing) --- diff --git a/qcsrc/common/physics/player.qc b/qcsrc/common/physics/player.qc index 0ecfa180f..541e9d61e 100644 --- a/qcsrc/common/physics/player.qc +++ b/qcsrc/common/physics/player.qc @@ -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) diff --git a/qcsrc/lib/csqcmodel/cl_player.qc b/qcsrc/lib/csqcmodel/cl_player.qc index 4e308ee56..13fb92749 100644 --- a/qcsrc/lib/csqcmodel/cl_player.qc +++ b/qcsrc/lib/csqcmodel/cl_player.qc @@ -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) |