From: Mario Date: Fri, 18 Aug 2017 14:57:24 +0000 (+1000) Subject: Add an anyrandom string to spawnmonster, which allows passive and hidden monsters... X-Git-Tag: xonotic-v0.8.5~2521 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=af7a412c892bfdf558237d14115e0ded49003767;p=xonotic%2Fxonotic-data.pk3dir.git Add an anyrandom string to spawnmonster, which allows passive and hidden monsters to be spawned --- diff --git a/qcsrc/common/monsters/sv_spawn.qc b/qcsrc/common/monsters/sv_spawn.qc index 4bbe2ce3d..d6989ad31 100644 --- a/qcsrc/common/monsters/sv_spawn.qc +++ b/qcsrc/common/monsters/sv_spawn.qc @@ -16,11 +16,12 @@ entity spawnmonster (entity e, string monster, int monster_id, entity spawnedby, //if(invincible) { e.spawnflags |= MONSTERFLAG_INVINCIBLE; } setorigin(e, orig); + bool allow_any = boolean(monster == "anyrandom"); - if(monster == "random") + if(monster == "random" || allow_any) { RandomSelection_Init(); - FOREACH(Monsters, it != MON_Null && !(it.spawnflags & MONSTER_TYPE_PASSIVE) && !(it.spawnflags & MON_FLAG_HIDDEN), + FOREACH(Monsters, it != MON_Null && (allow_any || (!(it.spawnflags & MONSTER_TYPE_PASSIVE) && !(it.spawnflags & MON_FLAG_HIDDEN))), { RandomSelection_AddEnt(it, 1, 1); });