return;
RandomSelection_Init();
- FOREACH_CLIENT(IS_PLAYER(it) && it != player && SAME_TEAM(it, player) && !IS_DEAD(it), LAMBDA(
+ FOREACH_CLIENT(IS_PLAYER(it) && it != player && SAME_TEAM(it, player) && !IS_DEAD(it), {
if(vdist(spawn_spot.origin - it.origin, >, autocvar_g_spawn_near_teammate_distance))
continue;
if(vdist(spawn_spot.origin - it.origin, <, 48))
if(!checkpvs(spawn_spot.origin, it))
continue;
RandomSelection_AddEnt(it, 1, 1);
- ));
+ });
if(RandomSelection_chosen_ent)
{
vector best_pos = '0 0 0';
float best_dist2 = FLOAT_MAX;
int tested = 0;
- FOREACH_CLIENT_RANDOM(IS_PLAYER(it), LAMBDA(
+ FOREACH_CLIENT_RANDOM(IS_PLAYER(it), {
if (autocvar_g_spawn_near_teammate_ignore_spawnpoint_max && tested >= autocvar_g_spawn_near_teammate_ignore_spawnpoint_max) break;
if (PHYS_INPUT_BUTTON_CHAT(it)) continue;
break; // don't test the other spots near this teammate, go to the next one
}
}
- ));
+ });
if(autocvar_g_spawn_near_teammate_ignore_spawnpoint_closetodeath)
if(best_mate)