Be a bit more explicit with checks for isplayermodel now that it can be valid checkin...
authorMario <mario@smbclan.net>
Wed, 23 Jan 2019 09:19:55 +0000 (19:19 +1000)
committerMario <mario@smbclan.net>
Wed, 23 Jan 2019 09:19:55 +0000 (19:19 +1000)
qcsrc/client/csqcmodel_hooks.qc
qcsrc/common/effects/qc/damageeffects.qc
qcsrc/common/mapobjects/func/ladder.qc
qcsrc/lib/csqcmodel/cl_player.qc

index 961fc77..c33c271 100644 (file)
@@ -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)
index 7ab6697..9090977 100644 (file)
@@ -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
        });
 
index 020ecca..6fb3a43 100644 (file)
@@ -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
 
index 268b591..04b96bc 100644 (file)
@@ -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);