]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add an anyrandom string to spawnmonster, which allows passive and hidden monsters...
authorMario <mario@smbclan.net>
Fri, 18 Aug 2017 14:57:24 +0000 (00:57 +1000)
committerMario <mario@smbclan.net>
Fri, 18 Aug 2017 14:57:24 +0000 (00:57 +1000)
qcsrc/common/monsters/sv_spawn.qc

index 4bbe2ce3d8f8a94fc336a0165e8009d0c16b0767..d6989ad31839d52229cc8f612879fd6c83ab8686 100644 (file)
@@ -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);
                });