prio = 0;
// filter out spots for the wrong team
- if(teamcheck)
- if(spot.team != teamcheck)
- return '-1 0 0';
+ if(teamcheck >= 0)
+ if(spot.team != teamcheck)
+ return '-1 0 0';
if(race_spawns)
if(spot.target == "")
spotlist = spot;
/*
- if(teamcheck)
+ if(teamcheck >= 0)
if(spot.team != teamcheck)
error("invalid spawn added");
/*
entity e;
- if(teamcheck)
+ if(teamcheck >= 0)
for(e = spotlist; e; e = e.chain)
{
print("seen ", etos(e), "\n");
if (spot)
return spot;
- teamcheck = 0;
-
- if(!anypoint && have_team_spawns > 0)
- teamcheck = self.team;
+ if(anypoint)
+ teamcheck = -1;
+ else if(have_team_spawns > 0)
+ teamcheck = self.team; // MUST be team
+ else if(have_team_spawns == 0 && have_noteam_spawns)
+ teamcheck = 0; // MUST be noteam
+ else
+ teamcheck = -1;
+ // if we get here, we either require team spawns but have none, or we require non-team spawns and have none; use any spawn then
// get the list of players
playerlist = findchain(classname, "player");
print("spot mindistance: ", vtos(spot.spawnpoint_score), "\n");
entity e;
- if(teamcheck)
+ if(teamcheck >= 0)
for(e = firstspot; e; e = e.chain)
if(e.team != teamcheck)
error("invalid spawn found");
float some_spawn_has_been_used;
float have_team_spawns; // 0 = no team spawns requested, -1 = team spawns requested but none found, 1 = team spawns requested and found
+float have_noteam_spawns; // 0 = no no-team spawns, 1 = no-team spawns exist
// set when showing a kill countdown
.entity killindicator;