From: Mario Date: Sat, 7 Jan 2017 13:48:46 +0000 (+1000) Subject: Add a hidden flag to monsters, so they don't show up in random spawning, invasion... X-Git-Tag: xonotic-v0.8.2~314 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=a9fccfdec3bd1b5f3f7ecc01cdbf3a01c832e068 Add a hidden flag to monsters, so they don't show up in random spawning, invasion or mob lists (similar to passive type, but more generally hidden) --- diff --git a/qcsrc/common/monsters/monster.qh b/qcsrc/common/monsters/monster.qh index 8e086a085c..a437e355d6 100644 --- a/qcsrc/common/monsters/monster.qh +++ b/qcsrc/common/monsters/monster.qh @@ -13,6 +13,7 @@ const int MON_FLAG_RIDE = BIT(12); // monster can be ridden in special modes const int MONSTER_SIZE_QUAKE = BIT(13); const int MONSTER_TYPE_PASSIVE = BIT(14); // doesn't target or chase enemies const int MONSTER_TYPE_UNDEAD = BIT(15); // monster is by most definitions a zombie (doesn't fully die unless gibbed) +const int MON_FLAG_HIDDEN = BIT(16); // entity properties of monsterinfo: .bool(int, entity actor, entity targ, .entity weaponentity) monster_attackfunc; diff --git a/qcsrc/common/monsters/sv_spawn.qc b/qcsrc/common/monsters/sv_spawn.qc index 497dee8666..884fb3dea1 100644 --- a/qcsrc/common/monsters/sv_spawn.qc +++ b/qcsrc/common/monsters/sv_spawn.qc @@ -20,7 +20,7 @@ entity spawnmonster (entity e, string monster, int monster_id, entity spawnedby, if(monster == "random") { RandomSelection_Init(); - FOREACH(Monsters, it != MON_Null && !(it.spawnflags & MONSTER_TYPE_PASSIVE), + FOREACH(Monsters, it != MON_Null && !(it.spawnflags & MONSTER_TYPE_PASSIVE) && !(it.spawnflags & MON_FLAG_HIDDEN), { RandomSelection_AddEnt(it, 1, 1); }); diff --git a/qcsrc/server/command/getreplies.qc b/qcsrc/server/command/getreplies.qc index d01448aad8..2fafc358cf 100644 --- a/qcsrc/server/command/getreplies.qc +++ b/qcsrc/server/command/getreplies.qc @@ -288,7 +288,7 @@ string getmonsterlist() { string monsterlist = ""; - FOREACH(Monsters, it != MON_Null, + FOREACH(Monsters, it != MON_Null && !(it.spawnflags & MON_FLAG_HIDDEN), { string col = ((i % 2) ? "^2" : "^3"); monsterlist = sprintf("%s%s%s ", monsterlist, col, it.netname); diff --git a/qcsrc/server/mutators/mutator/gamemode_invasion.qc b/qcsrc/server/mutators/mutator/gamemode_invasion.qc index 58e49980cc..aff46112c7 100644 --- a/qcsrc/server/mutators/mutator/gamemode_invasion.qc +++ b/qcsrc/server/mutators/mutator/gamemode_invasion.qc @@ -31,7 +31,8 @@ Monster invasion_PickMonster(int supermonster_count) FOREACH(Monsters, it != MON_Null, { - if((it.spawnflags & MONSTER_TYPE_PASSIVE) || (it.spawnflags & MONSTER_TYPE_FLY) || (it.spawnflags & MONSTER_TYPE_SWIM) || (it.spawnflags & MONSTER_SIZE_QUAKE) || ((it.spawnflags & MON_FLAG_SUPERMONSTER) && supermonster_count >= 1)) + if((it.spawnflags & MON_FLAG_HIDDEN) || (it.spawnflags & MONSTER_TYPE_PASSIVE) || (it.spawnflags & MONSTER_TYPE_FLY) || (it.spawnflags & MONSTER_TYPE_SWIM) || + (it.spawnflags & MONSTER_SIZE_QUAKE) || ((it.spawnflags & MON_FLAG_SUPERMONSTER) && supermonster_count >= 1)) continue; if(autocvar_g_invasion_zombies_only && !(it.spawnflags & MONSTER_TYPE_UNDEAD)) continue;