33 spawn_spot.msnt_lookat =
NULL;
39 if(
vdist(spawn_spot.origin - it.origin, <, 48))
51 else if(player.team == spawn_spot.team)
65 int num_red = 0, num_blue = 0, num_yellow = 0, num_pink = 0;
70 case NUM_TEAM_1: ++num_red; break;
71 case NUM_TEAM_2: ++num_blue; break;
72 case NUM_TEAM_3: ++num_yellow; break;
73 case NUM_TEAM_4: ++num_pink; break;
77 if(num_red == 1 || num_blue == 1 || num_yellow == 1 || num_pink == 1)
97 if (
time < it.msnt_timer)
continue;
98 if (StatusEffects_active(STATUSEFFECT_SpawnShield, it))
continue;
100 if (it == player)
continue;
108 if (
vdist(horiz_vel, >, autocvar_sv_maxspeed + 50))
120 snt_ofs[0] = up * 64 + right * 128 - forward * 64;
121 snt_ofs[1] = up * 64 - right * 128 - forward * 64;
122 snt_ofs[2] = up * 64 + right * 192;
123 snt_ofs[3] = up * 64 - right * 192;
124 snt_ofs[4] = up * 64 + right * 64 - forward * 128;
125 snt_ofs[5] = up * 64 - right * 64 - forward * 128;
127 for(
int i = 0; i < 6; ++i)
129 tracebox(it.origin, STAT(PL_MIN, player), STAT(PL_MAX, player), it.origin + snt_ofs[i],
MOVE_NOMONSTERS, it);
137 tracebox(horizontal_trace_endpos, STAT(PL_MIN, player), STAT(PL_MAX, player), horizontal_trace_endpos - 400 * up,
MOVE_NORMAL, it);
143 if (pointcontents(vectical_trace_endpos) !=
CONTENT_EMPTY)
goto skip;
144 if (tracebox_hits_trigger_hurt(horizontal_trace_endpos, STAT(PL_MIN, player), STAT(PL_MAX, player), vectical_trace_endpos))
goto skip;
148 vector floor_test_start = vectical_trace_endpos + up * STAT(PL_MAX, player).z + forward * STAT(PL_MAX, player).x;
149 traceline(floor_test_start, floor_test_start + forward * 100 - up * 128,
MOVE_NOMONSTERS, it);
153 if (autocvar_g_nades) {
154 bool nade_in_range =
false;
157 if (vdist(it.origin - vectical_trace_endpos, <, autocvar_g_nades_nade_radius)) {
158 nade_in_range = true;
162 if (nade_in_range)
goto skip;
175 if (dist2 < best_dist2)
199 player.angles = best_mate.angles;
204 else if(spawn_spot.msnt_lookat)
206 player.angles =
vectoangles(spawn_spot.msnt_lookat.origin - player.origin);
207 player.angles_x = -player.angles.x;
#define IL_EACH(this, cond, body)
#define PHYS_INPUT_BUTTON_CHAT(s)
vector RandomSelection_chosen_vec
string autocvar_g_spawn_near_teammate
vector Spawn_Score(entity this, entity spot, float mindist, float teamcheck, bool targetcheck)
float trace_dphitq3surfaceflags
ERASEABLE void RandomSelection_Init()
REGISTER_MUTATOR(spawn_near_teammate, expr_evaluate(autocvar_g_spawn_near_teammate))
bool autocvar_g_spawn_near_teammate_ignore_spawnpoint_check_health
#define FOREACH_CLIENT(cond, body)
const int SPAWN_PRIO_NEAR_TEAMMATE_SAMETEAM
MUTATOR_HOOKFUNCTION(spawn_near_teammate, Spawn_Score)
float checkpvs(vector viewpos, entity viewee)
bool autocvar_g_spawn_near_teammate_ignore_spawnpoint_closetodeath
float autocvar_g_spawn_near_teammate_ignore_spawnpoint_delay_death
float autocvar_g_spawn_near_teammate_ignore_spawnpoint_delay
float autocvar_g_balance_health_regenstable
const float CONTENT_EMPTY
#define RandomSelection_AddEnt(e, weight, priority)
bool weaponLocked(entity player)
const float MOVE_NOMONSTERS
entity RandomSelection_chosen_ent
vector(float skel, float bonenum) _skel_get_boneabs_hidden
IntrusiveList g_projectiles
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
const int SPAWN_PRIO_NEAR_TEAMMATE_FOUND
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
#define FOREACH_CLIENT_RANDOM(cond, body)
float autocvar_g_spawn_near_teammate_distance
int autocvar_g_spawn_near_teammate_ignore_spawnpoint_max
ERASEABLE void RandomSelection_Add(entity e, float f, string s, vector v, float weight, float priority)
ERASEABLE bool expr_evaluate(string s)
Evaluate an expression of the form: [+ | -]? [var[op]val | [op]var | val | var] ...
int autocvar_g_spawn_near_teammate_ignore_spawnpoint