]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a spawnflag to only attack targets infront of the monster
authorMario <mario.mario@y7mail.com>
Sun, 1 Sep 2013 17:33:28 +0000 (03:33 +1000)
committerMario <mario.mario@y7mail.com>
Sun, 1 Sep 2013 17:33:28 +0000 (03:33 +1000)
qcsrc/common/monsters/sv_monsters.qc
qcsrc/common/monsters/sv_monsters.qh

index 24794a08f21a399c045ec75352e19a78f36351a0..4f73eee3aa6bbcedcae3d86ed00bd1e984ab2432 100644 (file)
@@ -116,7 +116,7 @@ float monster_isvalidtarget (entity targ, entity ent)
        if not(IsDifferentTeam(targ, ent))
                return FALSE; // enemy is on our team
                
-       if(autocvar_g_monsters_target_infront)
+       if(autocvar_g_monsters_target_infront || ent.spawnflags & MONSTERFLAG_INFRONT)
        if(ent.enemy != targ)
        {
                float dot;
index 2cedf240e757c3258a5a3051d74080f5f6a7beb1..32f372edeeea4ef8900a1f5f1d2e074ab832b8c2 100644 (file)
@@ -43,6 +43,7 @@ const float MONSTERFLAG_MINIBOSS = 1;  // monster spawns as mini-boss (also has
 const float MONSTERFLAG_APPEAR = 2; // delay spawn until triggered
 const float MONSTERFLAG_NORESPAWN = 4;
 const float MONSTERFLAG_FLY_VERTICAL = 8; // fly/swim vertically
+const float MONSTERFLAG_INFRONT = 16; // only check for enemies infront of us
 const float MONSTERFLAG_SPAWNED = 512; // flag for spawned monsters
 
 .float msound_delay; // restricts some monster sounds