X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Flib%2Fcsqcmodel%2Fcl_model.qc;h=c07f94954bc97a4682f7e458e8947d31edddb853;hp=a9e5ac258ef81a722ac5a72ad85932ac079df82f;hb=6c1b876763dcb2d7e9e8d24c581b655ccce87a6f;hpb=f1a87492d9fed27a64d0e99c068705aba5509f26 diff --git a/qcsrc/lib/csqcmodel/cl_model.qc b/qcsrc/lib/csqcmodel/cl_model.qc index a9e5ac258e..c07f94954b 100644 --- a/qcsrc/lib/csqcmodel/cl_model.qc +++ b/qcsrc/lib/csqcmodel/cl_model.qc @@ -24,10 +24,10 @@ #include "cl_player.qh" #include "common.qh" #include "interpolate.qh" -#include "../../client/defs.qh" -#include "../../common/animdecide.qh" -#include "../../common/csqcmodel_settings.qh" -#include "../../common/util.qh" +#include +#include +#include +#include float autocvar_cl_lerpanim_maxdelta_framegroups = 0.1; float autocvar_cl_nolerp = 0; @@ -179,40 +179,39 @@ void CSQCModel_InterpolateAnimation_Do() #endif } -void CSQCModel_Draw() -{SELFPARAM(); +void CSQCModel_Draw(entity this) +{ // some nice flags for CSQCMODEL_IF and the hooks - bool isplayer = (self.entnum >= 1 && self.entnum <= maxclients); - noref bool islocalplayer = (self.entnum == player_localnum + 1); - noref bool isnolocalplayer = (isplayer && (self.entnum != player_localnum + 1)); + bool isplayer = (this.entnum >= 1 && this.entnum <= maxclients); + noref bool islocalplayer = (this.entnum == player_localnum + 1); + noref bool isnolocalplayer = (isplayer && (this.entnum != player_localnum + 1)); // we don't do this for the local player as that one is already handled // by CSQCPlayer_SetCamera() if (!CSQCPlayer_IsLocalPlayer(this)) InterpolateOrigin_Do(this); - CSQCModel_InterpolateAnimation_Do(); + WITH(entity, self, this, CSQCModel_InterpolateAnimation_Do()); { CSQCMODEL_HOOK_PREDRAW } // inherit draw flags easily - entity root = self; + entity root = this; while(root.tag_entity) root = root.tag_entity; - if(self != root) + if(this != root) { - self.renderflags &= ~(RF_EXTERNALMODEL | RF_VIEWMODEL); - self.renderflags |= (root.renderflags & (RF_EXTERNALMODEL | RF_VIEWMODEL)); + this.renderflags &= ~(RF_EXTERNALMODEL | RF_VIEWMODEL); + this.renderflags |= (root.renderflags & (RF_EXTERNALMODEL | RF_VIEWMODEL)); } // we're drawn, now teleporting is over - self.csqcmodel_teleported = 0; + this.csqcmodel_teleported = 0; } entity CSQCModel_players[255]; // 255 is engine limit on maxclients -void CSQCModel_remove() +void CSQCModel_remove(entity this) { - SELFPARAM(); CSQCModel_players[this.entnum - 1] = NULL; } @@ -290,7 +289,7 @@ NET_HANDLE(ENT_CLIENT_MODEL, bool isnew) // draw it this.drawmask = MASK_NORMAL; - this.predraw = CSQCModel_Draw; + setpredraw(this, CSQCModel_Draw); return true; }