bool autocvar_g_invasion_zombies_only;
float autocvar_g_invasion_spawn_delay;
+bool inv_warning_shown; // spammy
+
.string spawnmob;
spawnfunc(invasion_wave)
if(spawn_point == NULL)
{
- LOG_TRACE("Warning: couldn't find any invasion_spawnpoint spawnpoints, attempting to spawn monsters in random locations");
+ if(!inv_warning_shown)
+ {
+ inv_warning_shown = true;
+ LOG_TRACE("Warning: couldn't find any invasion_spawnpoint spawnpoints, attempting to spawn monsters in random locations");
+ }
entity e = spawn();
- setsize(e, mon.mins, mon.maxs);
+ setsize(e, mon.m_mins, mon.m_maxs);
if(MoveToRandomMapLocation(e, DPCONTENTS_SOLID | DPCONTENTS_CORPSE | DPCONTENTS_PLAYERCLIP, DPCONTENTS_SLIME | DPCONTENTS_LAVA | DPCONTENTS_SKY | DPCONTENTS_BODY | DPCONTENTS_DONOTENTER, Q3SURFACEFLAG_SKY, 10, 1024, 256))
monster = spawnmonster(e, tospawn, mon.monsterid, NULL, NULL, e.origin, false, false, 2);
}
}
+ if(monster.monster_attack)
+ IL_REMOVE(g_monster_targets, monster);
monster.monster_attack = false; // it's the player's job to kill all the monsters
if(inv_roundcnt >= inv_maxrounds)
}
else
{
- FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
+ FOREACH_CLIENT(IS_PLAYER(it), {
float cs = PlayerScore_Add(it, SP_KILLS, 0);
if(cs > winning_score)
{
winning_score = cs;
winner = it;
}
- ));
+ });
}
IL_EACH(g_monsters, true,
void Invasion_RoundStart()
{
int numplayers = 0;
- FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
+ FOREACH_CLIENT(IS_PLAYER(it), {
it.player_blocked = false;
++numplayers;
- ));
+ });
if(inv_roundcnt < inv_maxrounds)
inv_roundcnt += 1; // a limiter to stop crazy counts