Xonotic
spawnpoints.qc File Reference
+ Include dependency graph for spawnpoints.qc:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void link_spawnpoint (entity this)
 
void relocate_spawnpoint (entity this)
 
entity SelectSpawnPoint (entity this, bool anypoint)
 
entity Spawn_FilterOutBadSpots (entity this, entity firstspot, float mindist, float teamcheck, bool targetcheck)
 
vector Spawn_Score (entity this, entity spot, float mindist, float teamcheck, bool targetcheck)
 
void Spawn_ScoreAll (entity this, entity firstspot, float mindist, float teamcheck, bool targetcheck)
 
entity Spawn_WeightedPoint (entity firstspot, float lower, float upper, float exponent)
 
bool SpawnEvent_Send (entity this, entity to, int sf)
 
 spawnfunc (info_player_survivor)
 
 spawnfunc (info_player_start)
 
 spawnfunc (info_player_deathmatch)
 
 spawnfunc (info_player_team1)
 
 spawnfunc (info_player_team2)
 
 spawnfunc (info_player_team3)
 
 spawnfunc (info_player_team4)
 
void spawnpoint_reset (entity this)
 
bool SpawnPoint_Send (entity this, entity to, int sf)
 
void spawnpoint_think (entity this)
 
void spawnpoint_use (entity this, entity actor, entity trigger)
 

Variables

vector spawnpoint_prevorigin
 
bool testspawn_checked
 
entity testspawn_point
 

Function Documentation

◆ link_spawnpoint()

void link_spawnpoint ( entity  this)

Definition at line 82 of file spawnpoints.qc.

References autocvar_g_spawn_useallspawns, have_team_spawns, SpawnPoint_Send(), team, Team_IsValidTeam(), and teamplay.

Referenced by relocate_spawnpoint().

83 {
84  bool anypoint = (autocvar_g_spawn_useallspawns || (teamplay && have_team_spawns <= 0)); // TODO: check if available teams is equal to spawnpoints available
85 
86  // Don't show team spawns in non-team matches,
87  // and don't show non-team spawns in team matches.
88  // (Unless useallspawns is activated)
89  if(anypoint || !((teamplay && !Team_IsValidTeam(this.team)) || (!teamplay && Team_IsValidTeam(this.team))))
90  Net_LinkEntity(this, false, 0, SpawnPoint_Send);
91 }
int team
Definition: main.qh:157
int have_team_spawns
Definition: spawnpoints.qh:16
float teamplay
Definition: progsdefs.qc:31
bool SpawnPoint_Send(entity this, entity to, int sf)
Definition: spawnpoints.qc:22
bool autocvar_g_spawn_useallspawns
Definition: spawnpoints.qh:5
bool Team_IsValidTeam(int team_num)
Returns whether team value is valid.
Definition: teams.qh:133
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ relocate_spawnpoint()

void relocate_spawnpoint ( entity  this)

Definition at line 93 of file spawnpoints.qc.

References angles, autocvar_g_spawnpoints_auto_move_out_of_solid, autocvar_r_showbboxes, BIT, cnt, entity(), g_saved_team, have_team_spawns, have_team_spawns_forteams, IL_PUSH(), InitializeEntity(), link_spawnpoint(), LOG_INFO, LOG_INFOF, maxs, mins, move_out_of_solid, nextthink, objerror(), origin, random(), setorigin(), setthink, SOLID_TRIGGER, spawnpoint_nag, spawnpoint_reset(), spawnpoint_think(), spawnpoint_use(), team, team_saved, time, trace_startsolid, use, vector(), and vtos().

Referenced by spawnfunc().

94 {
95  // nudge off the floor
96  setorigin(this, this.origin + '0 0 1');
97 
98  tracebox(this.origin, PL_MIN_CONST, PL_MAX_CONST, this.origin, true, this);
99  if (trace_startsolid)
100  {
101  vector o;
102  o = this.origin;
103  this.mins = PL_MIN_CONST;
104  this.maxs = PL_MAX_CONST;
105  if (!move_out_of_solid(this))
106  objerror(this, "could not get out of solid at all!");
107  LOG_INFOF(
108  "^1NOTE: this map needs FIXING. Spawnpoint at %s needs to be moved out of solid, e.g. by %s",
109  vtos(o - '0 0 1'),
110  vtos(this.origin - o)
111  );
113  {
114  if (!spawnpoint_nag)
115  LOG_INFO("\{1}^1NOTE: this map needs FIXING (it contains spawnpoints in solid, see server log)");
116  spawnpoint_nag = 1;
117  }
118  else
119  {
120  setorigin(this, o);
121  this.mins = this.maxs = '0 0 0';
122  objerror(this, "player spawn point in solid, mapper sucks!\n");
123  return;
124  }
125  }
126 
127  this.use = spawnpoint_use;
128  setthink(this, spawnpoint_think);
129  this.nextthink = time + 0.5 + random() * 2; // shouldn't need it for a little second
130  this.reset2 = spawnpoint_reset; // restores team, allows re-sending the spawnpoint
131  this.team_saved = this.team;
132  IL_PUSH(g_saved_team, this);
133  if (!this.cnt)
134  this.cnt = 1;
135 
136  if (have_team_spawns != 0)
137  if (this.team)
138  have_team_spawns = 1;
140 
142  {
143  // show where spawnpoints point at too
144  vector forward, right, up;
145  MAKE_VECTORS(this.angles, forward, right, up);
146  entity e = new(info_player_foo);
147  setorigin(e, this.origin + forward * 24);
148  setsize(e, '-8 -8 -8', '8 8 8');
149  e.solid = SOLID_TRIGGER;
150  }
151 
152  // network it after all spawnpoints are setup, so that we can check if team spawnpoints are used
153  InitializeEntity(this, link_spawnpoint, INITPRIO_FINDTARGET);
154 }
void spawnpoint_think(entity this)
Definition: spawnpoints.qc:55
int have_team_spawns_forteams
Definition: spawnpoints.qh:17
int team
Definition: main.qh:157
int team_saved
Definition: vote.qh:68
int have_team_spawns
Definition: spawnpoints.qh:16
entity() spawn
float autocvar_r_showbboxes
Definition: spawnpoints.qh:7
vector maxs
Definition: csprogsdefs.qc:113
origin
Definition: ent_cs.qc:114
#define move_out_of_solid(e)
Definition: common.qh:110
void spawnpoint_use(entity this, entity actor, entity trigger)
Definition: spawnpoints.qc:65
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
Definition: bits.qh:8
bool autocvar_g_spawnpoints_auto_move_out_of_solid
Definition: spawnpoints.qh:6
vector mins
Definition: csprogsdefs.qc:113
float cnt
Definition: powerups.qc:24
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
#define LOG_INFOF(...)
Definition: log.qh:71
#define LOG_INFO(...)
Definition: log.qh:70
float nextthink
Definition: csprogsdefs.qc:121
vector(float skel, float bonenum) _skel_get_boneabs_hidden
void InitializeEntity(entity e, void(entity this) func, int order)
Definition: world.qc:2146
void spawnpoint_reset(entity this)
Definition: spawnpoints.qc:77
const float SOLID_TRIGGER
Definition: csprogsdefs.qc:245
IntrusiveList g_saved_team
Definition: vote.qh:77
setorigin(ent, v)
#define setthink(e, f)
vector angles
Definition: csprogsdefs.qc:104
#define use
Definition: csprogsdefs.qh:50
float trace_startsolid
Definition: csprogsdefs.qc:35
float time
Definition: csprogsdefs.qc:16
float spawnpoint_nag
Definition: spawnpoints.qh:20
void link_spawnpoint(entity this)
Definition: spawnpoints.qc:82
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SelectSpawnPoint()

entity SelectSpawnPoint ( entity  this,
bool  anypoint 
)

Definition at line 329 of file spawnpoints.qc.

References autocvar_g_spawn_furthest, autocvar_g_spawn_useallspawns, autocvar_spawn_debug, BIT, classname, entity(), error(), find(), g_spawnpoints, GotoNextMap(), have_team_spawns, have_team_spawns_forteams, IL_EACH, IL_FIRST, NULL, prev, random(), some_spawn_has_been_used, Spawn_FilterOutBadSpots(), Spawn_WeightedPoint(), team, testspawn_checked, and testspawn_point.

Referenced by buff_Respawn(), Damage(), ka_RespawnBall(), PutObserverInServer(), and PutPlayerInServer().

330 {
331  float teamcheck;
332  entity spot = NULL;
333 
334  if(!testspawn_checked)
335  {
336  testspawn_point = find(NULL, classname, "testplayerstart");
337  testspawn_checked = true;
338  }
339 
340  if(testspawn_point)
341  return testspawn_point;
342 
343  if(this.spawnpoint_targ)
344  return this.spawnpoint_targ;
345 
346  if(anypoint || autocvar_g_spawn_useallspawns)
347  teamcheck = -1;
348  else if(have_team_spawns > 0)
349  {
350  if(!(have_team_spawns_forteams & BIT(this.team)))
351  {
352  // we request a spawn for a team, and we have team
353  // spawns, but that team has no spawns?
355  // try noteam spawns
356  teamcheck = 0;
357  else
358  // if not, any spawn has to do
359  teamcheck = -1;
360  }
361  else
362  teamcheck = this.team; // MUST be team
363  }
364  else if(have_team_spawns == 0 && (have_team_spawns_forteams & BIT(0)))
365  teamcheck = 0; // MUST be noteam
366  else
367  teamcheck = -1;
368  // if we get here, we either require team spawns but have none, or we require non-team spawns and have none; use any spawn then
369 
370 
371  // get the entire list of spots
372  //entity firstspot = findchain(classname, "info_player_deathmatch");
373  entity firstspot = IL_FIRST(g_spawnpoints);
374  entity prev = NULL;
375  IL_EACH(g_spawnpoints, true,
376  {
377  if(prev)
378  prev.chain = it;
379  it.chain = NULL;
380  prev = it;
381  });
382  // filter out the bad ones
383  // (note this returns the original list if none survived)
384  if(anypoint)
385  {
386  spot = Spawn_WeightedPoint(firstspot, 1, 1, 1);
387  }
388  else
389  {
390  firstspot = Spawn_FilterOutBadSpots(this, firstspot, 100, teamcheck, true);
391 
392  // emergency fallback! double check without targets
393  // fixes some crashes with improperly repacked maps
394  if(!firstspot)
395  {
396  firstspot = IL_FIRST(g_spawnpoints);
397  prev = NULL;
398  IL_EACH(g_spawnpoints, true,
399  {
400  if(prev)
401  prev.chain = it;
402  it.chain = NULL;
403  prev = it;
404  });
405  firstspot = Spawn_FilterOutBadSpots(this, firstspot, 100, teamcheck, false);
406  }
407 
408  // there is 50/50 chance of choosing a random spot or the furthest spot
409  // (this means that roughly every other spawn will be furthest, so you
410  // usually won't get fragged at spawn twice in a row)
412  spot = Spawn_WeightedPoint(firstspot, 1, 1, 1);
413  else
414  spot = Spawn_WeightedPoint(firstspot, 1, 5000, 5); // chooses a far far away spawnpoint
415  }
416 
417  if (!spot)
418  {
420  GotoNextMap(0);
421  else
422  {
424  return NULL; // team can't spawn any more, because of actions of other team
425  else
426  error("Cannot find a spawn point - please fix the map!");
427  }
428  }
429 
430  return spot;
431 }
#define IL_EACH(this, cond, body)
int have_team_spawns_forteams
Definition: spawnpoints.qh:17
void GotoNextMap(float reinit)
int team
Definition: main.qh:157
int have_team_spawns
Definition: spawnpoints.qh:16
entity() spawn
prev
Definition: all.qh:66
int autocvar_spawn_debug
Definition: client.qh:50
#define IL_FIRST(this)
string classname
Definition: csprogsdefs.qc:107
float autocvar_g_spawn_furthest
Definition: spawnpoints.qh:4
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
Definition: bits.qh:8
entity Spawn_WeightedPoint(entity firstspot, float lower, float upper, float exponent)
Definition: spawnpoints.qc:307
#define NULL
Definition: post.qh:17
bool some_spawn_has_been_used
Definition: spawnpoints.qh:15
entity Spawn_FilterOutBadSpots(entity this, entity firstspot, float mindist, float teamcheck, bool targetcheck)
Definition: spawnpoints.qc:281
bool autocvar_g_spawn_useallspawns
Definition: spawnpoints.qh:5
bool testspawn_checked
Definition: spawnpoints.qc:327
entity testspawn_point
Definition: spawnpoints.qc:328
IntrusiveList g_spawnpoints
Definition: spawnpoints.qh:32
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Spawn_FilterOutBadSpots()

entity Spawn_FilterOutBadSpots ( entity  this,
entity  firstspot,
float  mindist,
float  teamcheck,
bool  targetcheck 
)

Definition at line 281 of file spawnpoints.qc.

References entity(), NULL, and Spawn_ScoreAll().

Referenced by SelectSpawnPoint(), and trigger_race_checkpoint_verify().

282 {
283  entity spot, spotlist, spotlistend;
284 
285  spotlist = NULL;
286  spotlistend = NULL;
287 
288  Spawn_ScoreAll(this, firstspot, mindist, teamcheck, targetcheck);
289 
290  for(spot = firstspot; spot; spot = spot.chain)
291  {
292  if(spot.spawnpoint_score.x >= 0) // spawning allowed here
293  {
294  if(spotlistend)
295  spotlistend.chain = spot;
296  spotlistend = spot;
297  if(!spotlist)
298  spotlist = spot;
299  }
300  }
301  if(spotlistend)
302  spotlistend.chain = NULL;
303 
304  return spotlist;
305 }
entity() spawn
void Spawn_ScoreAll(entity this, entity firstspot, float mindist, float teamcheck, bool targetcheck)
Definition: spawnpoints.qc:274
#define NULL
Definition: post.qh:17
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Spawn_Score()

vector Spawn_Score ( entity  this,
entity  spot,
float  mindist,
float  teamcheck,
bool  targetcheck 
)

Definition at line 213 of file spawnpoints.qc.

References entity(), FOREACH_CLIENT, g_cts, IS_DEAD, IS_PLAYER, IS_REAL_CLIENT, LOG_TRACE, M_ARGV, MUTATOR_CALLHOOK, race_spawns, SPAWN_PRIO_GOOD_DISTANCE, targetname, vector(), vlen(), vtos(), and world.

Referenced by Spawn_ScoreAll().

214 {
215  // filter out spots for the wrong team
216  if(teamcheck >= 0)
217  if(spot.team != teamcheck)
218  return '-1 0 0';
219 
220  if(race_spawns)
221  if(!spot.target || spot.target == "")
222  return '-1 0 0';
223 
224  if(IS_REAL_CLIENT(this))
225  {
226  if(spot.restriction == 1)
227  return '-1 0 0';
228  }
229  else
230  {
231  if(spot.restriction == 2)
232  return '-1 0 0';
233  }
234 
235  float prio = 0;
236  float shortest = vlen(world.maxs - world.mins);
237  FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it) && it != this, {
238  float thisdist = vlen(it.origin - spot.origin);
239  if (thisdist < shortest)
240  shortest = thisdist;
241  });
242  if(shortest > mindist)
243  prio += SPAWN_PRIO_GOOD_DISTANCE;
244 
245  vector spawn_score = prio * '1 0 0' + shortest * '0 1 0';
246 
247  // filter out spots for assault
248  if(spot.target && spot.target != "" && targetcheck)
249  {
250  int found = 0;
251  for(entity targ = findchain(targetname, spot.target); targ; targ = targ.chain)
252  {
253  ++found;
254  if(targ.spawn_evalfunc)
255  {
256  spawn_score = targ.spawn_evalfunc(targ, this, spot, spawn_score);
257  if(spawn_score.x < 0)
258  return spawn_score;
259  }
260  }
261 
262  if(!found && !g_cts)
263  {
264  LOG_TRACE("WARNING: spawnpoint at ", vtos(spot.origin), " could not find its target ", spot.target);
265  return '-1 0 0';
266  }
267  }
268 
269  MUTATOR_CALLHOOK(Spawn_Score, this, spot, spawn_score);
270  spawn_score = M_ARGV(2, vector);
271  return spawn_score;
272 }
entity world
Definition: csprogsdefs.qc:15
vector Spawn_Score(entity this, entity spot, float mindist, float teamcheck, bool targetcheck)
Definition: spawnpoints.qc:213
entity() spawn
float race_spawns
Definition: race.qh:17
#define FOREACH_CLIENT(cond, body)
Definition: utils.qh:49
const int SPAWN_PRIO_GOOD_DISTANCE
Definition: spawnpoints.qh:13
#define IS_REAL_CLIENT(v)
Definition: utils.qh:17
#define g_cts
Definition: cts.qh:36
#define M_ARGV(x, type)
Definition: events.qh:17
#define IS_DEAD(s)
Definition: utils.qh:26
vector(float skel, float bonenum) _skel_get_boneabs_hidden
#define LOG_TRACE(...)
Definition: log.qh:81
string targetname
Definition: progsdefs.qc:194
#define MUTATOR_CALLHOOK(id,...)
Definition: base.qh:140
#define IS_PLAYER(v)
Definition: utils.qh:9
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Spawn_ScoreAll()

void Spawn_ScoreAll ( entity  this,
entity  firstspot,
float  mindist,
float  teamcheck,
bool  targetcheck 
)

Definition at line 274 of file spawnpoints.qc.

References entity(), and Spawn_Score().

Referenced by Spawn_FilterOutBadSpots().

275 {
276  entity spot;
277  for(spot = firstspot; spot; spot = spot.chain)
278  spot.spawnpoint_score = Spawn_Score(this, spot, mindist, teamcheck, targetcheck);
279 }
vector Spawn_Score(entity this, entity spot, float mindist, float teamcheck, bool targetcheck)
Definition: spawnpoints.qc:213
entity() spawn
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Spawn_WeightedPoint()

entity Spawn_WeightedPoint ( entity  firstspot,
float  lower,
float  upper,
float  exponent 
)

Definition at line 307 of file spawnpoints.qc.

References bound(), entity(), RandomSelection_AddEnt, RandomSelection_chosen_ent, and RandomSelection_Init().

Referenced by SelectSpawnPoint().

308 {
309  // weight of a point: bound(lower, mindisttoplayer, upper)^exponent
310  // multiplied by spot.cnt (useful if you distribute many spawnpoints in a small area)
311  entity spot;
312 
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);
316 
318 }
ERASEABLE void RandomSelection_Init()
Definition: random.qc:4
entity() spawn
#define RandomSelection_AddEnt(e, weight, priority)
Definition: random.qh:14
entity RandomSelection_chosen_ent
Definition: random.qh:5
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SpawnEvent_Send()

bool SpawnEvent_Send ( entity  this,
entity  to,
int  sf 
)

Definition at line 32 of file spawnpoints.qc.

References autocvar_g_spawn_alloweffects, etof(), IS_SPEC, owner, and WriteByte().

Referenced by PutPlayerInServer().

33 {
34  float send;
35 
36  WriteHeader(MSG_ENTITY, ENT_CLIENT_SPAWNEVENT);
37 
39  {
40  WriteByte(MSG_ENTITY, etof(this.owner));
41  WriteVector(MSG_ENTITY, this.owner.origin);
42  send = true;
43  }
44  else if((to == this.owner) || (IS_SPEC(to) && (to.enemy == this.owner)) )
45  {
46  WriteByte(MSG_ENTITY, 0);
47  send = true;
48  }
49  else { send = false; }
50 
51  return send;
52 }
entity to
Definition: self.qh:96
entity owner
Definition: main.qh:73
#define IS_SPEC(v)
Definition: utils.qh:10
bool autocvar_g_spawn_alloweffects
Definition: spawnpoints.qh:3
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ spawnfunc() [1/7]

spawnfunc ( info_player_survivor  )

Definition at line 156 of file spawnpoints.qc.

157 {
158  spawnfunc_info_player_deathmatch(this);
159 }

◆ spawnfunc() [2/7]

spawnfunc ( info_player_start  )

Definition at line 161 of file spawnpoints.qc.

162 {
163  spawnfunc_info_player_deathmatch(this);
164 }

◆ spawnfunc() [3/7]

spawnfunc ( info_player_deathmatch  )

Definition at line 166 of file spawnpoints.qc.

References g_spawnpoints, IL_PUSH(), and relocate_spawnpoint().

167 {
168  IL_PUSH(g_spawnpoints, this);
169  relocate_spawnpoint(this);
170 }
void relocate_spawnpoint(entity this)
Definition: spawnpoints.qc:93
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
IntrusiveList g_spawnpoints
Definition: spawnpoints.qh:32
+ Here is the call graph for this function:

◆ spawnfunc() [4/7]

spawnfunc ( info_player_team1  )

Definition at line 175 of file spawnpoints.qc.

References NUM_TEAM_1, and team.

176 {
177  this.team = NUM_TEAM_1; // red
178  spawnfunc_info_player_deathmatch(this);
179 }
int team
Definition: main.qh:157
const int NUM_TEAM_1
Definition: teams.qh:18

◆ spawnfunc() [5/7]

spawnfunc ( info_player_team2  )

Definition at line 185 of file spawnpoints.qc.

References NUM_TEAM_2, and team.

186 {
187  this.team = NUM_TEAM_2; // blue
188  spawnfunc_info_player_deathmatch(this);
189 }
const int NUM_TEAM_2
Definition: teams.qh:19
int team
Definition: main.qh:157

◆ spawnfunc() [6/7]

spawnfunc ( info_player_team3  )

Definition at line 194 of file spawnpoints.qc.

References NUM_TEAM_3, and team.

195 {
196  this.team = NUM_TEAM_3; // yellow
197  spawnfunc_info_player_deathmatch(this);
198 }
int team
Definition: main.qh:157
const int NUM_TEAM_3
Definition: teams.qh:20

◆ spawnfunc() [7/7]

spawnfunc ( info_player_team4  )

Definition at line 204 of file spawnpoints.qc.

References NUM_TEAM_4, and team.

205 {
206  this.team = NUM_TEAM_4; // purple
207  spawnfunc_info_player_deathmatch(this);
208 }
int team
Definition: main.qh:157
const int NUM_TEAM_4
Definition: teams.qh:21

◆ spawnpoint_reset()

void spawnpoint_reset ( entity  this)

Definition at line 77 of file spawnpoints.qc.

Referenced by relocate_spawnpoint().

78 {
79  this.SendFlags |= 1; // update team since it was restored during reset
80 }
+ Here is the caller graph for this function:

◆ SpawnPoint_Send()

bool SpawnPoint_Send ( entity  this,
entity  to,
int  sf 
)

Definition at line 22 of file spawnpoints.qc.

References origin, team, and WriteByte().

Referenced by link_spawnpoint().

23 {
24  WriteHeader(MSG_ENTITY, ENT_CLIENT_SPAWNPOINT);
25 
26  WriteByte(MSG_ENTITY, this.team);
27  WriteVector(MSG_ENTITY, this.origin);
28 
29  return true;
30 }
int team
Definition: main.qh:157
origin
Definition: ent_cs.qc:114
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ spawnpoint_think()

void spawnpoint_think ( entity  this)

Definition at line 55 of file spawnpoints.qc.

References nextthink, origin, spawnpoint_prevorigin, and time.

Referenced by relocate_spawnpoint().

56 {
57  this.nextthink = time + 0.1;
58  if(this.origin != this.spawnpoint_prevorigin)
59  {
60  this.spawnpoint_prevorigin = this.origin;
61  this.SendFlags |= 1;
62  }
63 }
origin
Definition: ent_cs.qc:114
float nextthink
Definition: csprogsdefs.qc:121
vector spawnpoint_prevorigin
Definition: spawnpoints.qc:54
float time
Definition: csprogsdefs.qc:16
+ Here is the caller graph for this function:

◆ spawnpoint_use()

void spawnpoint_use ( entity  this,
entity  actor,
entity  trigger 
)

Definition at line 65 of file spawnpoints.qc.

References have_team_spawns, some_spawn_has_been_used, team, and teamplay.

Referenced by relocate_spawnpoint().

66 {
67  if(teamplay)
68  if(have_team_spawns > 0)
69  {
70  this.team = actor.team;
72  this.SendFlags |= 1; // update team on the client side
73  }
74  //LOG_INFO("spawnpoint was used!\n");
75 }
int team
Definition: main.qh:157
int have_team_spawns
Definition: spawnpoints.qh:16
bool some_spawn_has_been_used
Definition: spawnpoints.qh:15
float teamplay
Definition: progsdefs.qc:31
+ Here is the caller graph for this function:

Variable Documentation

◆ spawnpoint_prevorigin

vector spawnpoint_prevorigin

Definition at line 54 of file spawnpoints.qc.

Referenced by spawnpoint_think().

◆ testspawn_checked

bool testspawn_checked

Definition at line 327 of file spawnpoints.qc.

Referenced by SelectSpawnPoint().

◆ testspawn_point

entity testspawn_point

Definition at line 328 of file spawnpoints.qc.

Referenced by SelectSpawnPoint().