#ifdef SVQC
+IntrusiveList g_targetmusic_list;
+STATIC_INIT(g_targetmusic_list) { g_targetmusic_list = IL_NEW(); }
+
// values:
// volume
// noise
}
void target_music_kill()
{
- FOREACH_ENTITY_CLASS("target_music", true, {
+ IL_EACH(g_targetmusic_list, true,
+ {
it.volume = 0;
if (it.targetname == "")
target_music_sendto(it, MSG_ALL, 1);
this.reset = target_music_reset;
if(!this.volume)
this.volume = 1;
+ IL_PUSH(g_targetmusic_list, this);
if(this.targetname == "")
target_music_sendto(this, MSG_INIT, 1);
else
}
void TargetMusic_RestoreGame()
{
- FOREACH_ENTITY_CLASS("target_music", true,
+ IL_EACH(g_targetmusic_list, true,
{
if(it.targetname == "")
target_music_sendto(it, MSG_INIT, 1);
entity Teleport_Find(vector mi, vector ma)
{
- entity e;
- for(e = NULL; (e = find(e, classname, "trigger_teleport")); )
- if(WarpZoneLib_BoxTouchesBrush(mi, ma, e, NULL))
- return e;
+ IL_EACH(g_teleporters, WarpZoneLib_BoxTouchesBrush(mi, ma, it, NULL),
+ {
+ return it;
+ });
return NULL;
}
#pragma once
+IntrusiveList g_teleporters;
+STATIC_INIT(g_teleporters) { g_teleporters = IL_NEW(); }
+
.entity pusher;
const float TELEPORT_FLAG_SOUND = 1;
const float TELEPORT_FLAG_PARTICLES = 2;
return;
}
+ IL_PUSH(g_teleporters, this);
+
this.teleport_next = teleport_first;
teleport_first = this;
}
NET_HANDLE(ENT_CLIENT_TRIGGER_TELEPORT, bool isnew)
{
this.classname = "trigger_teleport";
+ if(isnew)
+ IL_PUSH(g_teleporters, this);
int mytm = ReadByte(); if(mytm) { this.team = mytm - 1; }
this.spawnflags = ReadInt24_t();
this.active = ReadByte();
this.aistatus |= AI_STATUS_WAYPOINT_PERSONAL_LINKING;
// if pos is inside a teleport, then let's mark it as teleport waypoint
- FOREACH_ENTITY_CLASS("trigger_teleport", WarpZoneLib_BoxTouchesBrush(pos, pos, it, NULL),
+ IL_EACH(g_teleporters, WarpZoneLib_BoxTouchesBrush(pos, pos, it, NULL),
{
wp.wpflags |= WAYPOINTFLAG_TELEPORT;
this.lastteleporttime = 0;
}
));
- FOREACH_ENTITY_CLASS("info_player_deathmatch", true, LAMBDA(
+ FOREACH_ENTITY_CLASS("info_player_deathmatch", true,
+ {
switch(it.team)
{
case NUM_TEAM_1: team1_score = 1; break;
case NUM_TEAM_3: team3_score = 1; break;
case NUM_TEAM_4: team4_score = 1; break;
}
- ));
+ });
ClearWinners();
if(team1_score + team2_score + team3_score + team4_score == 0)
#include <server/teamplay.qh>
+IntrusiveList g_invasion_spawns;
+STATIC_INIT(g_invasion_spawns) { g_invasion_spawns = IL_NEW(); }
float autocvar_g_invasion_round_timelimit;
float autocvar_g_invasion_spawnpoint_spawn_delay;
if(!g_invasion) { delete(this); return; }
this.classname = "invasion_spawnpoint";
+ IL_PUSH(g_invasion_spawns, this);
if(autocvar_g_invasion_zombies_only) // precache only if it hasn't been already
if(this.monsterid) {
{
RandomSelection_Init();
- FOREACH_ENTITY_CLASS("invasion_spawnpoint", true,
+ IL_EACH(g_invasion_spawns, true,
{
RandomSelection_Add(it, 0, string_null, 1, ((time >= it.spawnshieldtime) ? 0.2 : 1)); // give recently used spawnpoints a very low rating
it.spawnshieldtime = time + autocvar_g_invasion_spawnpoint_spawn_delay;