if(!(self.spawnflags & MONSTERFLAG_SPAWNED) && !self.monster_respawned)
monsters_killed += 1;
+ if(self.realowner.classname == "monster_spawner")
+ self.realowner.spawner_monstercount -= 1;
+
if(self.realowner.flags & FL_CLIENT)
self.realowner.monstercount -= 1;
monster_hook_death(); // for post-death mods
}
-void spawner_recount()
-{
- self.spawner_monstercount = 0;
- self.think = spawner_think;
- self.nextthink = time;
-}
-
void spawner_think()
{
float finished = FALSE;
if(self.spawner_monstercount >= autocvar_g_monster_spawner_maxmobs)
{
- self.think = spawner_recount;
- self.nextthink = time + 10 + random() * 4;
- return;
+ self.nextthink = time + 5;
}
if (self.spawner_monstercount <= autocvar_g_monster_spawner_maxmobs)
self.nextthink = time + 1;
- if(self.spawner_monstercount <= autocvar_g_monster_spawner_maxmobs)
- self.nextthink = time + 0.1;
-
- if not(finished)
+ if(self.spawner_monstercount <= autocvar_g_monster_spawner_maxmobs || !finished)
self.nextthink = time + 0.1;
}
totalmonsters += autocvar_g_td_monster_count_increment * wave_count;
monster_skill += autocvar_g_td_monsters_skill_increment;
- monsters_total = totalmonsters;
- monsters_killed = 0;
-
if(wave_count < 1) wave_count = 1;
genhealmsg = (gen_washealed) ? ((td_gencount == 1) ? " and generator " : " and generators ") : "";
if(totalmonsters < 1) totalmonsters = ((autocvar_g_td_monster_count > 0) ? autocvar_g_td_monster_count : 10);
- rint(totalmonsters); // to be safe
+ monsters_total = totalmonsters;
+ monsters_killed = 0;
print(strcat(buildmsg, healmsg, countmsg, startmsg, "\n"));