From: Mario Date: Sun, 1 Sep 2013 17:33:28 +0000 (+1000) Subject: Add a spawnflag to only attack targets infront of the monster X-Git-Tag: xonotic-v0.8.0~241^2^2~109 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b213208c275a492a0ae2a0045e74a5b055b20498;p=xonotic%2Fxonotic-data.pk3dir.git Add a spawnflag to only attack targets infront of the monster --- diff --git a/qcsrc/common/monsters/sv_monsters.qc b/qcsrc/common/monsters/sv_monsters.qc index 24794a08f..4f73eee3a 100644 --- a/qcsrc/common/monsters/sv_monsters.qc +++ b/qcsrc/common/monsters/sv_monsters.qc @@ -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; diff --git a/qcsrc/common/monsters/sv_monsters.qh b/qcsrc/common/monsters/sv_monsters.qh index 2cedf240e..32f372ede 100644 --- a/qcsrc/common/monsters/sv_monsters.qh +++ b/qcsrc/common/monsters/sv_monsters.qh @@ -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