From: Mario Date: Tue, 30 Aug 2016 18:53:49 +0000 (+1000) Subject: Optimize it further X-Git-Tag: xonotic-v0.8.2~638 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b32e41d024a4bff48918c4886edae6c6c6067211;p=xonotic%2Fxonotic-data.pk3dir.git Optimize it further --- diff --git a/qcsrc/common/monsters/sv_monsters.qc b/qcsrc/common/monsters/sv_monsters.qc index 3b2286935..3d937bef8 100644 --- a/qcsrc/common/monsters/sv_monsters.qc +++ b/qcsrc/common/monsters/sv_monsters.qc @@ -101,12 +101,10 @@ bool Monster_ValidTarget(entity this, entity targ) traceline(this.origin + this.view_ofs, targ.origin, MOVE_NORMAL, this); - if(trace_fraction < 1) + if(trace_fraction < 1 && trace_ent != targ) + if(!autocvar_g_monsters_ignoretraces || !trace_ent.iscreature) return false; // solid - if(trace_ent != targ && !autocvar_g_monsters_ignoretraces) - return false; // not our enemy - if(autocvar_g_monsters_target_infront || (this.spawnflags & MONSTERFLAG_INFRONT)) if(this.enemy != targ) {