46 else if((to == this.
owner) || (
IS_SPEC(to) && (to.enemy ==
this.owner)) )
51 else { send =
false; }
72 this.
team = actor.team;
86 int old_status = this.
active;
92 if(this.
active != old_status)
120 setorigin(
this, this.
origin +
'0 0 1');
130 objerror(
this,
"could not get out of solid at all!");
132 "^1NOTE: this map needs FIXING. Spawnpoint at %s needs to be moved out of solid, e.g. by %s",
139 LOG_INFO(
"\{1}^1NOTE: this map needs FIXING (it contains spawnpoints in solid, see server log)");
146 objerror(
this,
"player spawn point in solid, mapper sucks!\n");
171 vector forward, right, up;
173 entity e =
new(info_player_foo);
174 setorigin(e, this.
origin + forward * 24);
175 setsize(e,
'-8 -8 -8',
'8 8 8');
185 spawnfunc_info_player_deathmatch(
this);
190 spawnfunc_info_player_deathmatch(
this);
205 spawnfunc_info_player_deathmatch(
this);
215 spawnfunc_info_player_deathmatch(
this);
224 spawnfunc_info_player_deathmatch(
this);
234 spawnfunc_info_player_deathmatch(
this);
244 if(spot.team != teamcheck)
248 if(!spot.target || spot.target ==
"")
256 if(spot.restriction == 1)
261 if(spot.restriction == 2)
268 float thisdist =
vlen(it.origin - spot.origin);
269 if (thisdist < shortest)
272 if(shortest > mindist)
275 vector spawn_score = prio *
'1 0 0' + shortest *
'0 1 0';
278 if(spot.target && spot.target !=
"" && targetcheck)
281 for(
entity targ = findchain(
targetname, spot.target); targ; targ = targ.chain)
284 if(targ.spawn_evalfunc)
286 spawn_score = targ.spawn_evalfunc(targ,
this, spot, spawn_score);
287 if(spawn_score.x < 0)
294 LOG_TRACE(
"WARNING: spawnpoint at ",
vtos(spot.origin),
" could not find its target ", spot.target);
307 for(spot = firstspot; spot; spot = spot.chain)
308 spot.spawnpoint_score =
Spawn_Score(
this, spot, mindist, teamcheck, targetcheck);
313 entity spot, spotlist, spotlistend;
320 for(spot = firstspot; spot; spot = spot.chain)
322 if(spot.spawnpoint_score.x >= 0)
325 spotlistend.chain = spot;
332 spotlistend.chain =
NULL;
344 for(spot = firstspot; spot; spot = spot.chain)
345 RandomSelection_AddEnt(spot, (
bound(lower, spot.spawnpoint_score.y, upper) ** exponent) * spot.cnt, (spot.spawnpoint_score.y >= lower) * 0.5 + spot.spawnpoint_score.x);
392 teamcheck = this.
team;
456 error(
"Cannot find a spawn point - please fix the map!");
#define MUTATOR_CALLHOOK(id,...)
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
const vector PL_MIN_CONST
const int INITPRIO_FINDTARGET
const vector PL_MAX_CONST
const float SOLID_TRIGGER
#define MAKE_VECTORS(angles, forward, right, up)
Same as the makevectors builtin but uses the provided locals instead of the v_* globals.
void GotoNextMap(float reinit)
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
#define IL_EACH(this, cond, body)
#define WriteHeader(to, id)
void Net_LinkEntity(entity e, bool docull, float dt, bool(entity this, entity to, int sendflags) sendfunc)
#define move_out_of_solid(e)
ERASEABLE void RandomSelection_Init()
#define RandomSelection_AddEnt(e, weight, priority)
entity RandomSelection_chosen_ent
IntrusiveList g_saved_team
void spawnpoint_think(entity this)
void spawnpoint_use(entity this, entity actor, entity trigger)
void Spawn_ScoreAll(entity this, entity firstspot, float mindist, float teamcheck, bool targetcheck)
bool SpawnEvent_Send(entity this, entity to, int sf)
entity SelectSpawnPoint(entity this, bool anypoint)
void spawnpoint_reset(entity this)
entity Spawn_WeightedPoint(entity firstspot, float lower, float upper, float exponent)
void relocate_spawnpoint(entity this)
bool spawnpoint_customize(entity this, entity client)
void spawnpoint_setactive(entity this, int act)
vector Spawn_Score(entity this, entity spot, float mindist, float teamcheck, bool targetcheck)
vector spawnpoint_prevorigin
void link_spawnpoint(entity this)
bool SpawnPoint_Send(entity this, entity to, int sf)
entity Spawn_FilterOutBadSpots(entity this, entity firstspot, float mindist, float teamcheck, bool targetcheck)
const int SPAWN_PRIO_GOOD_DISTANCE
bool autocvar_g_spawn_useallspawns
bool autocvar_g_spawnpoints_auto_move_out_of_solid
int have_team_spawns_forteams
bool some_spawn_has_been_used
IntrusiveList g_spawnpoints
float autocvar_g_spawn_furthest
float autocvar_r_showbboxes
int autocvar_g_spawn_alloweffects
bool Team_IsValidTeam(int team_num)
Returns whether team value is valid.
#define IS_REAL_CLIENT(v)
#define FOREACH_CLIENT(cond, body)
void InitializeEntity(entity e, void(entity this) func, int order)