]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a hidden flag to monsters, so they don't show up in random spawning, invasion...
authorMario <mario@smbclan.net>
Sat, 7 Jan 2017 13:48:46 +0000 (23:48 +1000)
committerMario <mario@smbclan.net>
Sat, 7 Jan 2017 13:48:46 +0000 (23:48 +1000)
qcsrc/common/monsters/monster.qh
qcsrc/common/monsters/sv_spawn.qc
qcsrc/server/command/getreplies.qc
qcsrc/server/mutators/mutator/gamemode_invasion.qc

index 8e086a085c62218ba68ee20cc7107f933f9da320..a437e355d63e847535858bb78b59fe78fc306edb 100644 (file)
@@ -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;
index 497dee86664b54d644f405e4be5ea47fc01969e9..884fb3dea154828ee26b392be65e1cfb48afdf8e 100644 (file)
@@ -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);
                });
index d01448aad81ca4d022f415c42d12759eebff606a..2fafc358cf6b415527d6619535e0eeb58ac57b4c 100644 (file)
@@ -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);
index 58e49980cc2439a0bcb5fa4a5fa72260886fa0bd..aff46112c763f7ea47070e56cff43407a30d187d 100644 (file)
@@ -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;