24 WriteHeader(MSG_ENTITY, ENT_CLIENT_SPAWNPOINT);
27 WriteVector(MSG_ENTITY, this.
origin);
36 WriteHeader(MSG_ENTITY, ENT_CLIENT_SPAWNEVENT);
41 WriteVector(MSG_ENTITY, this.
owner.origin);
44 else if((to == this.
owner) || (
IS_SPEC(to) && (to.enemy ==
this.owner)) )
49 else { send =
false; }
70 this.
team = actor.team;
98 tracebox(this.
origin, PL_MIN_CONST, PL_MAX_CONST, this.
origin,
true,
this);
103 this.
mins = PL_MIN_CONST;
104 this.
maxs = PL_MAX_CONST;
106 objerror(
this,
"could not get out of solid at all!");
108 "^1NOTE: this map needs FIXING. Spawnpoint at %s needs to be moved out of solid, e.g. by %s",
115 LOG_INFO(
"\{1}^1NOTE: this map needs FIXING (it contains spawnpoints in solid, see server log)");
122 objerror(
this,
"player spawn point in solid, mapper sucks!\n");
144 vector forward, right, up;
145 MAKE_VECTORS(this.
angles, forward, right, up);
146 entity e =
new(info_player_foo);
148 setsize(e,
'-8 -8 -8',
'8 8 8');
158 spawnfunc_info_player_deathmatch(
this);
163 spawnfunc_info_player_deathmatch(
this);
178 spawnfunc_info_player_deathmatch(
this);
188 spawnfunc_info_player_deathmatch(
this);
197 spawnfunc_info_player_deathmatch(
this);
207 spawnfunc_info_player_deathmatch(
this);
217 if(spot.team != teamcheck)
221 if(!spot.target || spot.target ==
"")
226 if(spot.restriction == 1)
231 if(spot.restriction == 2)
238 float thisdist =
vlen(it.origin - spot.origin);
239 if (thisdist < shortest)
242 if(shortest > mindist)
245 vector spawn_score = prio *
'1 0 0' + shortest *
'0 1 0';
248 if(spot.target && spot.target !=
"" && targetcheck)
251 for(
entity targ = findchain(
targetname, spot.target); targ; targ = targ.chain)
254 if(targ.spawn_evalfunc)
256 spawn_score = targ.spawn_evalfunc(targ,
this, spot, spawn_score);
257 if(spawn_score.x < 0)
264 LOG_TRACE(
"WARNING: spawnpoint at ",
vtos(spot.origin),
" could not find its target ", spot.target);
277 for(spot = firstspot; spot; spot = spot.chain)
278 spot.spawnpoint_score =
Spawn_Score(
this, spot, mindist, teamcheck, targetcheck);
283 entity spot, spotlist, spotlistend;
290 for(spot = firstspot; spot; spot = spot.chain)
292 if(spot.spawnpoint_score.x >= 0)
295 spotlistend.chain = spot;
302 spotlistend.chain =
NULL;
314 for(spot = firstspot; spot; spot = spot.chain)
315 RandomSelection_AddEnt(spot, (
bound(lower, spot.spawnpoint_score.y, upper) ** exponent) * spot.cnt, (spot.spawnpoint_score.y >= lower) * 0.5 + spot.spawnpoint_score.x);
343 if(this.spawnpoint_targ)
344 return this.spawnpoint_targ;
362 teamcheck = this.
team;
426 error(
"Cannot find a spawn point - please fix the map!");
entity SelectSpawnPoint(entity this, bool anypoint)
void spawnpoint_think(entity this)
#define IL_EACH(this, cond, body)
vector Spawn_Score(entity this, entity spot, float mindist, float teamcheck, bool targetcheck)
int have_team_spawns_forteams
void GotoNextMap(float reinit)
void relocate_spawnpoint(entity this)
ERASEABLE void RandomSelection_Init()
#define FOREACH_CLIENT(cond, body)
float autocvar_r_showbboxes
const int SPAWN_PRIO_GOOD_DISTANCE
void Spawn_ScoreAll(entity this, entity firstspot, float mindist, float teamcheck, bool targetcheck)
spawnfunc(info_player_survivor)
#define move_out_of_solid(e)
float autocvar_g_spawn_furthest
#define IS_REAL_CLIENT(v)
void spawnpoint_use(entity this, entity actor, entity trigger)
bool SpawnEvent_Send(entity this, entity to, int sf)
#define RandomSelection_AddEnt(e, weight, priority)
bool autocvar_g_spawn_alloweffects
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
bool autocvar_g_spawnpoints_auto_move_out_of_solid
entity Spawn_WeightedPoint(entity firstspot, float lower, float upper, float exponent)
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
entity RandomSelection_chosen_ent
bool some_spawn_has_been_used
vector(float skel, float bonenum) _skel_get_boneabs_hidden
entity Spawn_FilterOutBadSpots(entity this, entity firstspot, float mindist, float teamcheck, bool targetcheck)
bool SpawnPoint_Send(entity this, entity to, int sf)
void InitializeEntity(entity e, void(entity this) func, int order)
void spawnpoint_reset(entity this)
const float SOLID_TRIGGER
vector spawnpoint_prevorigin
#define MUTATOR_CALLHOOK(id,...)
IntrusiveList g_saved_team
bool autocvar_g_spawn_useallspawns
bool Team_IsValidTeam(int team_num)
Returns whether team value is valid.
IntrusiveList g_spawnpoints
void link_spawnpoint(entity this)