X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Flib%2Fcsqcmodel%2Fcl_player.qc;h=04b96bc9974974cf98656754bf9aeb1b0583502a;hb=4b615d6ea3ee6794ea9368c782393c66ef55c170;hp=9e26e70fb7424ff07d3fbf79747bffe218c1dd4f;hpb=c5fcf672c473edef7139d4250398184b8ae17224;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/lib/csqcmodel/cl_player.qc b/qcsrc/lib/csqcmodel/cl_player.qc index 9e26e70fb..04b96bc99 100644 --- a/qcsrc/lib/csqcmodel/cl_player.qc +++ b/qcsrc/lib/csqcmodel/cl_player.qc @@ -25,15 +25,6 @@ #include "cl_model.qh" #include "common.qh" #include "interpolate.qh" -#include -#include -#include -#include -#include -#include -#include -#include -#include float autocvar_cl_movement_errorcompensation = 0; bool autocvar_cl_movement_intermissionrunning = false; @@ -107,17 +98,17 @@ void CSQCPlayer_Unpredict(entity this) void CSQCPlayer_SetMinsMaxs(entity this) { - if (IS_DUCKED(this) || !this.isplayermodel) + if (IS_DUCKED(this) || !(this.isplayermodel & ISPLAYER_PLAYER)) { - this.mins = STAT(PL_CROUCH_MIN, this); - this.maxs = STAT(PL_CROUCH_MAX, this); - this.view_ofs = STAT(PL_CROUCH_VIEW_OFS, this); + this.mins = PHYS_PL_CROUCH_MIN(this); + this.maxs = PHYS_PL_CROUCH_MAX(this); + this.view_ofs = PHYS_PL_CROUCH_VIEWOFS(this); } else { - this.mins = STAT(PL_MIN, this); - this.maxs = STAT(PL_MAX, this); - this.view_ofs = STAT(PL_VIEW_OFS, this); + this.mins = PHYS_PL_MIN(this); + this.maxs = PHYS_PL_MAX(this); + this.view_ofs = PHYS_PL_VIEWOFS(this); } } @@ -177,7 +168,7 @@ void CSQCPlayer_PredictTo(entity this, float endframe, bool apply_error) { csqcplayer_moveframe = clientcommandframe; getinputstate(csqcplayer_moveframe-1); - LOG_INFO("the Weird code path got hit\n"); + LOG_INFO("the Weird code path got hit"); return; } #endif @@ -216,19 +207,14 @@ bool CSQCPlayer_IsLocalPlayer(entity this) return (this == csqcplayer); } -void CSQCPlayer_SetViewLocation() -{ - viewloc_SetViewLocation(); -} - /** Called once per CSQC_UpdateView() */ void CSQCPlayer_SetCamera() { - const vector v0 = ((intermission && !autocvar_cl_movement_intermissionrunning) ? '0 0 0' : pmove_vel); // TRICK: pmove_vel is set by the engine when we get here. No need to network velocity - const float vh = STAT(VIEWHEIGHT); - const vector pl_viewofs = STAT(PL_VIEW_OFS); - const vector pl_viewofs_crouch = STAT(PL_CROUCH_VIEW_OFS); - const entity e = csqcplayer; + vector v0 = ((intermission && !autocvar_cl_movement_intermissionrunning) ? '0 0 0' : pmove_vel); // TRICK: pmove_vel is set by the engine when we get here. No need to network velocity + float vh = PHYS_VIEWHEIGHT(NULL); + vector pl_viewofs = PHYS_PL_VIEWOFS(NULL); + vector pl_viewofs_crouch = PHYS_PL_CROUCH_VIEWOFS(NULL); + entity e = csqcplayer; if (e) { if (servercommandframe == 0 || clientcommandframe == 0) @@ -253,13 +239,13 @@ void CSQCPlayer_SetCamera() } else { - const int flg = e.iflags; e.iflags &= ~(IFLAG_ORIGIN | IFLAG_ANGLES); + int flg = e.iflags; e.iflags &= ~(IFLAG_ORIGIN | IFLAG_ANGLES); InterpolateOrigin_Do(e); e.iflags = flg; if (csqcplayer_status == CSQCPLAYERSTATUS_FROMSERVER) { - const vector o = e.origin; + vector o = e.origin; csqcplayer_status = CSQCPLAYERSTATUS_PREDICTED; CSQCPlayer_PredictTo(e, servercommandframe + 1, false); CSQCPlayer_SetPredictionError(e.origin - o, e.velocity - v0, pmove_onground - IS_ONGROUND(e)); @@ -303,9 +289,9 @@ 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 && STAT(HEALTH) != -666 && STAT(HEALTH) != -2342) refdefflags |= REFDEFFLAG_DEAD; + if (PHYS_HEALTH(NULL) <= 0 && PHYS_HEALTH(NULL) != -666 && PHYS_HEALTH(NULL) != -2342) refdefflags |= REFDEFFLAG_DEAD; if (intermission) refdefflags |= REFDEFFLAG_INTERMISSION; - V_CalcRefdef(view, refdefflags); + V_CalcRefdef(view, refdefflags); // TODO? uses .health stat in the engine when this isn't called here, may be broken! } else {