float autocvar_g_spawn_near_teammate_distance;
int autocvar_g_spawn_near_teammate_ignore_spawnpoint;
int autocvar_g_spawn_near_teammate_ignore_spawnpoint_max;
float autocvar_g_spawn_near_teammate_distance;
int autocvar_g_spawn_near_teammate_ignore_spawnpoint;
int autocvar_g_spawn_near_teammate_ignore_spawnpoint_max;
bool autocvar_g_spawn_near_teammate_ignore_spawnpoint_check_health;
bool autocvar_g_spawn_near_teammate_ignore_spawnpoint_closetodeath;
bool autocvar_g_spawn_near_teammate_ignore_spawnpoint_check_health;
bool autocvar_g_spawn_near_teammate_ignore_spawnpoint_closetodeath;
entity player = M_ARGV(0, entity);
entity spawn_spot = M_ARGV(1, entity);
vector spawn_score = M_ARGV(2, vector);
entity player = M_ARGV(0, entity);
entity spawn_spot = M_ARGV(1, entity);
vector spawn_score = M_ARGV(2, vector);
if(vdist(spawn_spot.origin - it.origin, >, autocvar_g_spawn_near_teammate_distance))
continue;
if(vdist(spawn_spot.origin - it.origin, <, 48))
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(!checkpvs(spawn_spot.origin, it))
continue;
RandomSelection_AddEnt(it, 1, 1);
entity player = M_ARGV(0, entity);
entity spawn_spot = M_ARGV(1, entity);
entity player = M_ARGV(0, entity);
entity spawn_spot = M_ARGV(1, entity);
return; // at least 1 team has only 1 player, let's not give the bigger team too much of an advantage!
// Note: when entering this, fixangle is already set.
return; // at least 1 team has only 1 player, let's not give the bigger team too much of an advantage!
// Note: when entering this, fixangle is already set.
{
if(autocvar_g_spawn_near_teammate_ignore_spawnpoint_delay_death)
player.msnt_timer = time + autocvar_g_spawn_near_teammate_ignore_spawnpoint_delay_death;
{
if(autocvar_g_spawn_near_teammate_ignore_spawnpoint_delay_death)
player.msnt_timer = time + autocvar_g_spawn_near_teammate_ignore_spawnpoint_delay_death;
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;
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;
- tracebox(it.origin, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), it.origin - v_forward * 64 + v_right * 128 + v_up * 64, MOVE_NOMONSTERS, it);
+ tracebox(it.origin, STAT(PL_MIN, player), STAT(PL_MAX, player), it.origin - v_forward * 64 + v_right * 128 + v_up * 64, MOVE_NOMONSTERS, it);
- tracebox(it.origin, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), it.origin - v_forward * 64 - v_right * 128 + v_up * 64, MOVE_NOMONSTERS, it);
+ tracebox(it.origin, STAT(PL_MIN, player), STAT(PL_MAX, player), it.origin - v_forward * 64 - v_right * 128 + v_up * 64, MOVE_NOMONSTERS, it);
- tracebox(it.origin, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), it.origin + v_right * 192 + v_up * 64, MOVE_NOMONSTERS, it);
+ tracebox(it.origin, STAT(PL_MIN, player), STAT(PL_MAX, player), it.origin + v_right * 192 + v_up * 64, MOVE_NOMONSTERS, it);
- tracebox(it.origin, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), it.origin - v_right * 192 + v_up * 64, MOVE_NOMONSTERS, it);
+ tracebox(it.origin, STAT(PL_MIN, player), STAT(PL_MAX, player), it.origin - v_right * 192 + v_up * 64, MOVE_NOMONSTERS, it);
- tracebox(it.origin, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), it.origin - v_forward * 128 + v_right * 64 + v_up * 64, MOVE_NOMONSTERS, it);
+ tracebox(it.origin, STAT(PL_MIN, player), STAT(PL_MAX, player), it.origin - v_forward * 128 + v_right * 64 + v_up * 64, MOVE_NOMONSTERS, it);
- tracebox(it.origin, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), it.origin - v_forward * 128 - v_right * 64 + v_up * 64, MOVE_NOMONSTERS, it);
+ tracebox(it.origin, STAT(PL_MIN, player), STAT(PL_MAX, player), it.origin - v_forward * 128 - v_right * 64 + v_up * 64, MOVE_NOMONSTERS, it);
// 400 is about the height of a typical laser jump (in overkill)
// not traceline because we need space for the whole player, not just his origin
// 400 is about the height of a typical laser jump (in overkill)
// not traceline because we need space for the whole player, not just his origin
- tracebox(horizontal_trace_endpos, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), horizontal_trace_endpos - '0 0 400', MOVE_NORMAL, it);
+ tracebox(horizontal_trace_endpos, STAT(PL_MIN, player), STAT(PL_MAX, player), horizontal_trace_endpos - '0 0 400', MOVE_NORMAL, it);
vector vectical_trace_endpos = trace_endpos;
//te_lightning1(NULL, horizontal_trace_endpos, vectical_trace_endpos);
if (trace_startsolid) goto skip; // inside another player
if (trace_fraction == 1.0) goto skip; // above void or too high
if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_SKY) goto skip;
if (pointcontents(vectical_trace_endpos) != CONTENT_EMPTY) goto skip; // no lava or slime (or water which i assume would be annoying anyway)
vector vectical_trace_endpos = trace_endpos;
//te_lightning1(NULL, horizontal_trace_endpos, vectical_trace_endpos);
if (trace_startsolid) goto skip; // inside another player
if (trace_fraction == 1.0) goto skip; // above void or too high
if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_SKY) goto skip;
if (pointcontents(vectical_trace_endpos) != CONTENT_EMPTY) goto skip; // no lava or slime (or water which i assume would be annoying anyway)
- if (tracebox_hits_trigger_hurt(horizontal_trace_endpos, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), vectical_trace_endpos)) goto skip;
+ if (tracebox_hits_trigger_hurt(horizontal_trace_endpos, STAT(PL_MIN, player), STAT(PL_MAX, player), vectical_trace_endpos)) goto skip;
- vector floor_test_start = vectical_trace_endpos + v_up * STAT(PL_MAX, NULL).z + v_forward * STAT(PL_MAX, NULL).x; // top front of player's bbox - highest point we know is not inside solid
+ vector floor_test_start = vectical_trace_endpos + v_up * STAT(PL_MAX, player).z + v_forward * STAT(PL_MAX, player).x; // top front of player's bbox - highest point we know is not inside solid
traceline(floor_test_start, floor_test_start + v_forward * 100 - v_up * 128, MOVE_NOMONSTERS, it);
//te_beam(NULL, floor_test_start, trace_endpos);
if (trace_fraction == 1.0) goto skip;
traceline(floor_test_start, floor_test_start + v_forward * 100 - v_up * 128, MOVE_NOMONSTERS, it);
//te_beam(NULL, floor_test_start, trace_endpos);
if (trace_fraction == 1.0) goto skip;