#include "spawnpoints.qh"
-#include "mutators/all.qh"
+#include "mutators/_mod.qh"
#include "g_world.qh"
#include "race.qh"
#include "../common/constants.qh"
+#include <common/net_linked.qh>
#include "../common/teams.qh"
#include "../common/triggers/subs.qh"
#include "../common/util.qh"
if(have_team_spawns > 0)
{
this.team = actor.team;
- some_spawn_has_been_used = 1;
+ some_spawn_has_been_used = true;
}
//LOG_INFO("spawnpoint was used!\n");
}
setthink(this, spawnpoint_think);
this.nextthink = time + 0.5 + random() * 2; // shouldn't need it for a little second
this.team_saved = this.team;
+ IL_PUSH(g_saved_team, this);
if (!this.cnt)
this.cnt = 1;
if (have_team_spawns != 0)
if (this.team)
have_team_spawns = 1;
- have_team_spawns_forteam[this.team] = 1;
+ have_team_spawns_forteams |= BIT(this.team);
if (autocvar_r_showbboxes)
{
spawnfunc(info_player_deathmatch)
{
this.classname = "info_player_deathmatch";
+ IL_PUSH(g_spawnpoints, this);
relocate_spawnpoint(this);
}
RandomSelection_Init();
for(spot = firstspot; spot; spot = spot.chain)
- RandomSelection_Add(spot, 0, string_null, pow(bound(lower, spot.spawnpoint_score.y, upper), exponent) * spot.cnt, (spot.spawnpoint_score.y >= lower) * 0.5 + spot.spawnpoint_score.x);
+ RandomSelection_AddEnt(spot, (bound(lower, spot.spawnpoint_score.y, upper) ** exponent) * spot.cnt, (spot.spawnpoint_score.y >= lower) * 0.5 + spot.spawnpoint_score.x);
return RandomSelection_chosen_ent;
}
float teamcheck;
entity spot, firstspot;
- spot = find (NULL, classname, "testplayerstart");
+ spot = find(NULL, classname, "testplayerstart");
if (spot)
return spot;
teamcheck = -1;
else if(have_team_spawns > 0)
{
- if(have_team_spawns_forteam[this.team] == 0)
+ if(!(have_team_spawns_forteams & BIT(this.team)))
{
// we request a spawn for a team, and we have team
// spawns, but that team has no spawns?
- if(have_team_spawns_forteam[0])
+ if(have_team_spawns_forteams & BIT(0))
// try noteam spawns
teamcheck = 0;
else
else
teamcheck = this.team; // MUST be team
}
- else if(have_team_spawns == 0 && have_team_spawns_forteam[0])
+ else if(have_team_spawns == 0 && (have_team_spawns_forteams & BIT(0)))
teamcheck = 0; // MUST be noteam
else
teamcheck = -1;