]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/gamemode_invasion.qc
Use a spawnflag to check if the monster has re-spawned
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / gamemode_invasion.qc
index f7442c1ca03e53a6462863f17e9fdc01a2402ab9..2147e6a816720859ebd01d590e1042e660b89d32 100644 (file)
@@ -18,7 +18,7 @@ float invasion_PickMonster(float supermonster_count)
        for(i = MON_FIRST; i <= MON_LAST; ++i)
        {
                mon = get_monsterinfo(i);
-               if((mon.spawnflags & MONSTER_TYPE_FLY) || (mon.spawnflags & MONSTER_TYPE_SWIM) || (mon.spawnflags & MON_FLAG_SUPERMONSTER && supermonster_count >= 1))
+               if((mon.spawnflags & MONSTER_TYPE_FLY) || (mon.spawnflags & MONSTER_TYPE_SWIM) || ((mon.spawnflags & MON_FLAG_SUPERMONSTER) && supermonster_count >= 1))
                        continue; // flying/swimming monsters not yet supported
 
                RandomSelection_Add(world, i, "", 1, 1);
@@ -183,7 +183,7 @@ void Invasion_RoundStart()
 
 MUTATOR_HOOKFUNCTION(invasion_MonsterDies)
 {
-       if(!self.monster_respawned)
+       if(!(self.spawnflags & MONSTERFLAG_RESPAWNED))
        {
                numkilled += 1;
                maxcurrent -= 1;
@@ -206,7 +206,7 @@ MUTATOR_HOOKFUNCTION(invasion_MonsterSpawn)
        if(roundcnt < maxrounds && self.spawnflags & MONSTERFLAG_MINIBOSS)
                self.spawnflags &= ~MONSTERFLAG_MINIBOSS;
 
-       if(!self.monster_respawned)
+       if(!(self.spawnflags & MONSTERFLAG_RESPAWNED))
        {
                numspawned += 1;
                maxcurrent += 1;