.float team_saved;
-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_team_spawns_forteam[17]; // 0 = this team has no spawns, 1 = this team has spawns; team 0 is the "no-team"
+bool some_spawn_has_been_used;
+int have_team_spawns; // 0 = no team spawns requested, -1 = team spawns requested but none found, 1 = team spawns requested and found
+int have_team_spawns_forteams; // if Xth bit is 1 then team X has spawns else it has no spawns; team 0 is the "no-team"
// set when showing a kill countdown
.entity killindicator;
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");
}
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)
{
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;