X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Flib%2Fcsqcmodel%2Fcl_model.qc;h=ccf6751171f82522181d75e529d103ac5b848847;hb=821a95136fb3a11f2094f61f2954ea5e8966a378;hp=6b86092967e67dd5b9638bafce9585ebfbec16fb;hpb=9185b58da6fe5f2b095d7066577e1e024b4d2798;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/lib/csqcmodel/cl_model.qc b/qcsrc/lib/csqcmodel/cl_model.qc index 6b8609296..ccf675117 100644 --- a/qcsrc/lib/csqcmodel/cl_model.qc +++ b/qcsrc/lib/csqcmodel/cl_model.qc @@ -24,10 +24,7 @@ #include "cl_player.qh" #include "common.qh" #include "interpolate.qh" -#include -#include #include -#include float autocvar_cl_lerpanim_maxdelta_framegroups = 0.1; float autocvar_cl_nolerp = 0; @@ -182,7 +179,7 @@ void CSQCModel_InterpolateAnimation_Do(entity this) void CSQCModel_Draw(entity this) { // some nice flags for CSQCMODEL_IF and the hooks - bool isplayer = (this.entnum >= 1 && this.entnum <= maxclients); + bool isplayer = (this.isplayermodel & ISPLAYER_CLIENT); noref bool islocalplayer = (this.entnum == player_localnum + 1); noref bool isnolocalplayer = (isplayer && (this.entnum != player_localnum + 1)); @@ -194,6 +191,14 @@ void CSQCModel_Draw(entity this) CSQCModel_Hook_PreDraw(this, isplayer); + if(isplayer) + { + if(this.entnum == player_localentnum) + this.renderflags |= RF_EXTERNALMODEL; + else + this.renderflags &= ~RF_EXTERNALMODEL; + } + // inherit draw flags easily entity root = this; while(root.tag_entity) @@ -218,9 +223,10 @@ void CSQCModel_remove(entity this) NET_HANDLE(ENT_CLIENT_MODEL, bool isnew) { int sf = ReadInt24_t(); + int psf = ReadByte(); // some nice flags for CSQCMODEL_IF and the hooks - bool isplayer = ReadByte() || (this.entnum >= 1 && this.entnum <= maxclients); + bool isplayer = (psf & ISPLAYER_CLIENT) || (this.entnum >= 1 && this.entnum <= maxclients); if (isnew && isplayer) { CSQCModel_players[this.entnum - 1] = this; @@ -229,6 +235,10 @@ NET_HANDLE(ENT_CLIENT_MODEL, bool isnew) bool islocalplayer = (this.entnum == player_localnum + 1); noref bool isnolocalplayer = (isplayer && !islocalplayer); + this.isplayermodel = BITSET(this.isplayermodel, ISPLAYER_CLIENT, isplayer); + this.isplayermodel = BITSET(this.isplayermodel, ISPLAYER_LOCAL, islocalplayer); + this.isplayermodel = BITSET(this.isplayermodel, ISPLAYER_PLAYER, (psf & ISPLAYER_PLAYER)); + this.classname = "csqcmodel"; this.iflags |= IFLAG_ORIGIN; // interpolate origin too this.iflags |= IFLAG_ANGLES; // interpolate angles too @@ -267,6 +277,12 @@ NET_HANDLE(ENT_CLIENT_MODEL, bool isnew) this.csqcmodel_teleported = 1; } + if(sf & BIT(3)) + this.alpha = this.m_alpha; + + if(sf & BIT(14)) + viewloc_SetTags(this); + CSQCModel_InterpolateAnimation_Note(this, sf); InterpolateOrigin_Note(this); CSQCPlayer_PostUpdate(this);