]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/lib/csqcmodel/cl_player.qc
Merge branch 'master' into Mario/entrap_nade
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / csqcmodel / cl_player.qc
index 869dcd7706a5e27ccf92327cf39e40bec0361989..0b0de75649aab42d97851711fca47dd1342c8bf8 100644 (file)
 #include "cl_model.qh"
 #include "common.qh"
 #include "interpolate.qh"
-#include "../../client/defs.qh"
-#include "../../client/main.qh"
-#include "../../common/constants.qh"
-#include "../../common/physics/player.qh"
-#include "../../common/stats.qh"
-#include "../../common/triggers/trigger/viewloc.qh"
-#include "../../common/util.qh"
-#include "../../common/viewloc.qh"
+#include <client/defs.qh>
+#include <client/main.qh>
+#include <common/constants.qh>
+#include <common/physics/player.qh>
+#include <common/stats.qh>
+#include <common/triggers/trigger/viewloc.qh>
+#include <common/util.qh>
+#include <common/viewloc.qh>
 
 float autocvar_cl_movement_errorcompensation = 0;
 
@@ -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) |
@@ -323,7 +333,7 @@ void CSQCPlayer_SetCamera()
                if (view.csqcmodel_teleported) refdefflags |= REFDEFFLAG_TELEPORTED;
                if (input_buttons & BIT(1)) refdefflags |= REFDEFFLAG_JUMPING;
                // note: these two only work in WIP2, but are harmless in WIP1
-               if (STAT(HEALTH) <= 0) refdefflags |= REFDEFFLAG_DEAD;
+               if (STAT(HEALTH) <= 0 && STAT(HEALTH) != -666 && STAT(HEALTH) != -2342) refdefflags |= REFDEFFLAG_DEAD;
                if (intermission) refdefflags |= REFDEFFLAG_INTERMISSION;
                V_CalcRefdef(view, refdefflags);
        }
@@ -339,7 +349,7 @@ void CSQCPlayer_SetCamera()
        CSQCPLAYER_HOOK_POSTCAMERASETUP();
 }
 
-void CSQCPlayer_Remove()
+void CSQCPlayer_Remove(entity this)
 {
        csqcplayer = NULL;
        cvar_settemp("cl_movement_replay", "1");