return 0;
}
- IL_EACH("saved_cvar_value", it.netname == tmp_cvar,
+ IL_EACH(g_saved_cvars, it.netname == tmp_cvar,
{
created_saved_value = -1; // skip creation
break; // no need to continue
IntrusiveList g_assault_objectivedecreasers;
STATIC_INIT(g_assault_objectivedecreasers) { g_assault_objectivedecreasers = IL_NEW(); }
+
+IntrusiveList g_spawnpoints;
+STATIC_INIT(g_spawnpoints) { g_spawnpoints = IL_NEW(); }
static_init_late();
static_init_precache();
+ IL_PUSH(g_spawnpoints, e); // just incase
+
MapInfo_Enumerate();
MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 0);
}
}
));
- FOREACH_ENTITY_CLASS("info_player_deathmatch", true,
+ IL_EACH(g_spawnpoints, true,
{
switch(it.team)
{
if (m) LOG_INFOF("%d waypoints have been marked total\n", m);
j = 0;
- FOREACH_ENTITY_CLASS("info_player_deathmatch", true,
+ IL_EACH(g_spawnpoints, true,
{
vector org = it.origin;
tracebox(it.origin, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), it.origin - '0 0 512', MOVE_NOMONSTERS, NULL);
{
float m, i;
vector start, org, delta, end, enddown, mstart;
- entity sp;
m = e.dphitcontentsmask;
e.dphitcontentsmask = goodcontents | badcontents;
continue;
// rule 4: we must "see" some spawnpoint or item
- for(sp = NULL; (sp = find(sp, classname, "info_player_deathmatch")); )
- if(checkpvs(mstart, sp))
- if((traceline(mstart, sp.origin, MOVE_NORMAL, e), trace_fraction) >= 1)
- break;
+ entity sp = NULL;
+ IL_EACH(g_spawnpoints, checkpvs(mstart, it),
+ {
+ if((traceline(mstart, it.origin, MOVE_NORMAL, e), trace_fraction) >= 1)
+ {
+ sp = it;
+ break;
+ }
+ });
if(!sp)
{
IL_EACH(g_items, checkpvs(mstart, it),
spawnfunc(info_player_deathmatch)
{
this.classname = "info_player_deathmatch";
+ IL_PUSH(g_spawnpoints, this);
relocate_spawnpoint(this);
}