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");
}
this.maxs = PL_MAX_CONST;
if (!move_out_of_solid(this))
objerror(this, "could not get out of solid at all!");
- LOG_INFO("^1NOTE: this map needs FIXING. Spawnpoint at ", vtos(o - '0 0 1'));
- LOG_INFO(" needs to be moved out of solid, e.g. by '", ftos(this.origin.x - o.x));
- LOG_INFO(" ", ftos(this.origin.y - o.y));
- LOG_INFO(" ", ftos(this.origin.z - o.z), "'\n");
+ LOG_INFOF(
+ "^1NOTE: this map needs FIXING. Spawnpoint at %s needs to be moved out of solid, e.g. by %s",
+ vtos(o - '0 0 1'),
+ vtos(this.origin - o)
+ );
if (autocvar_g_spawnpoints_auto_move_out_of_solid)
{
if (!spawnpoint_nag)
- LOG_INFO("\{1}^1NOTE: this map needs FIXING (it contains spawnpoints in solid, see server log)\n");
+ LOG_INFO("\{1}^1NOTE: this map needs FIXING (it contains spawnpoints in solid, see server log)");
spawnpoint_nag = 1;
}
else
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)
{
}
shortest = vlen(world.maxs - world.mins);
- FOREACH_CLIENT(IS_PLAYER(it) && it != this, LAMBDA(
+ FOREACH_CLIENT(IS_PLAYER(it) && it != this, {
thisdist = vlen(it.origin - spot.origin);
if (thisdist < shortest)
shortest = thisdist;
- ));
+ });
if(shortest > mindist)
prio += SPAWN_PRIO_GOOD_DISTANCE;
RandomSelection_Init();
for(spot = firstspot; spot; spot = spot.chain)
- RandomSelection_AddEnt(spot, 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;
}
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;