From af7a412c892bfdf558237d14115e0ded49003767 Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 19 Aug 2017 00:57:24 +1000 Subject: [PATCH] Add an anyrandom string to spawnmonster, which allows passive and hidden monsters to be spawned --- qcsrc/common/monsters/sv_spawn.qc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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); }); -- 2.39.2