]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Optimize it further
authorMario <mario@smbclan.net>
Tue, 30 Aug 2016 18:53:49 +0000 (04:53 +1000)
committerMario <mario@smbclan.net>
Tue, 30 Aug 2016 18:53:49 +0000 (04:53 +1000)
qcsrc/common/monsters/sv_monsters.qc

index 3b2286935d6290c150da08c80c6b7fd285aedaa2..3d937bef8bf3027a0b694b48590d79c8fb4e05dc 100644 (file)
@@ -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)
        {