From: Mario Date: Wed, 23 Jan 2019 09:19:55 +0000 (+1000) Subject: Be a bit more explicit with checks for isplayermodel now that it can be valid checkin... X-Git-Tag: xonotic-v0.8.5~1646 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8fdd6f852a81ab40e157d39cc3a56ecd0592f7b7;p=xonotic%2Fxonotic-data.pk3dir.git Be a bit more explicit with checks for isplayermodel now that it can be valid checking against clients (possibly needs renaming!) --- diff --git a/qcsrc/client/csqcmodel_hooks.qc b/qcsrc/client/csqcmodel_hooks.qc index 961fc7757..c33c271fa 100644 --- a/qcsrc/client/csqcmodel_hooks.qc +++ b/qcsrc/client/csqcmodel_hooks.qc @@ -441,7 +441,7 @@ void CSQCModel_AutoTagIndex_Apply(entity this) LOG_TRACE("h_ model lacks weapon attachment, but v_ model is attached to it"); } } - else if(this.tag_entity.isplayermodel) + else if((this.tag_entity.isplayermodel & ISPLAYER_MODEL)) { skeleton_loadinfo(this.tag_entity); this.tag_index = this.tag_entity.bone_weapon; @@ -606,7 +606,7 @@ void CSQCModel_Hook_PreDraw(entity this, bool isplayer) else this.drawmask = MASK_NORMAL; - if(this.isplayermodel && this.drawmask) // this checks if it's a player MODEL! + if((this.isplayermodel & ISPLAYER_MODEL) && this.drawmask) // this checks if it's a player MODEL! { CSQCPlayer_ModelAppearance_Apply(this, (this.isplayermodel & ISPLAYER_LOCAL)); CSQCPlayer_LOD_Apply(this); @@ -697,7 +697,7 @@ void CSQCModel_Hook_PreUpdate(entity this, bool isnew, bool isplayer, bool isloc this.iflags |= IFLAG_V_ANGLE_X; // revert to values from server CSQCModel_Effects_PreUpdate(this); - if(this.isplayermodel) + if((this.isplayermodel & ISPLAYER_MODEL)) { if(!isplayer) CSQCPlayer_FallbackFrame_PreUpdate(this); @@ -713,7 +713,7 @@ void CSQCModel_Hook_PostUpdate(entity this, bool isnew, bool isplayer, bool islo this.isplayermodel = BITSET(this.isplayermodel, ISPLAYER_MODEL, is_playermodel); // save values set by server - if(this.isplayermodel) + if((this.isplayermodel & ISPLAYER_MODEL)) { CSQCPlayer_ModelAppearance_PostUpdate(this); if(isplayer) diff --git a/qcsrc/common/effects/qc/damageeffects.qc b/qcsrc/common/effects/qc/damageeffects.qc index 7ab6697c3..9090977da 100644 --- a/qcsrc/common/effects/qc/damageeffects.qc +++ b/qcsrc/common/effects/qc/damageeffects.qc @@ -78,7 +78,7 @@ void DamageEffect_Think(entity this) return; } this.state = this.owner.csqcmodel_isdead; - if(this.owner.isplayermodel && (this.owner.isplayermodel & ISPLAYER_LOCAL) && !autocvar_chase_active) + if((this.owner.isplayermodel & ISPLAYER_LOCAL) && !autocvar_chase_active) return; // if we aren't using a third person camera, hide our own effects // now generate the particles @@ -153,7 +153,7 @@ void DamageEffect(entity this, vector hitorg, float thedamage, int type, int spe if(substring(effectname, strlen(effectname) - 5, 5) == "BLOOD") { - if(this.isplayermodel) + if((this.isplayermodel & ISPLAYER_MODEL)) { specstr = species_prefix(specnum); specstr = substring(specstr, 0, strlen(specstr) - 1); @@ -250,7 +250,7 @@ NET_HANDLE(ENT_CLIENT_DAMAGEINFO, bool isNew) DamageEffect(it, w_org, thisdmg, w_deathtype, species); - if(it.isplayermodel) + if((it.isplayermodel & ISPLAYER_MODEL)) hitplayer = true; // this impact damaged a player }); diff --git a/qcsrc/common/mapobjects/func/ladder.qc b/qcsrc/common/mapobjects/func/ladder.qc index 020ecca08..6fb3a435a 100644 --- a/qcsrc/common/mapobjects/func/ladder.qc +++ b/qcsrc/common/mapobjects/func/ladder.qc @@ -9,7 +9,7 @@ void func_ladder_touch(entity this, entity toucher) if(IS_VEHICLE(toucher)) return; #elif defined(CSQC) - if(!toucher.isplayermodel) + if(!IS_PLAYER(toucher)) // don't allow non-player predicted entities! return; #endif diff --git a/qcsrc/lib/csqcmodel/cl_player.qc b/qcsrc/lib/csqcmodel/cl_player.qc index 268b59126..04b96bc99 100644 --- a/qcsrc/lib/csqcmodel/cl_player.qc +++ b/qcsrc/lib/csqcmodel/cl_player.qc @@ -98,7 +98,7 @@ 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 = PHYS_PL_CROUCH_MIN(this); this.maxs = PHYS_PL_CROUCH_MAX(this);