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

Go to the source code of this file.

Macros

#define _IMPULSE(id)
 
#define IMPULSE(id)   _IMPULSE(IMP_##id)
 
#define X(i)
 
#define X(i, dir)
 
#define X(i)
 
#define X(id)   case IMP_##id.impulse:
 

Functions

 for (int slot=0;slot< MAX_WEAPONSLOTS;++slot)
 
 if (IS_DEAD(this))
 
 IMPULSE (weapon_prev_byid)
 
 IMPULSE (weapon_next_bygroup)
 
 IMPULSE (weapon_prev_bygroup)
 
 IMPULSE (weapon_next_bypriority)
 
 IMPULSE (weapon_prev_bypriority)
 
 IMPULSE (weapon_last)
 
 IMPULSE (weapon_best)
 
 IMPULSE (weapon_drop)
 
 IMPULSE (weapon_reload)
 
 IMPULSE (use)
 
 IMPULSE (waypoint_personal_here)
 
 IMPULSE (waypoint_personal_crosshair)
 
 IMPULSE (waypoint_personal_death)
 
 IMPULSE (waypoint_here_follow)
 
 IMPULSE (waypoint_here_here)
 
 IMPULSE (waypoint_here_crosshair)
 
 IMPULSE (waypoint_here_death)
 
 IMPULSE (waypoint_danger_here)
 
 IMPULSE (waypoint_danger_crosshair)
 
 IMPULSE (waypoint_danger_death)
 
 IMPULSE (waypoint_clear_personal)
 
 IMPULSE (waypoint_clear)
 
void ImpulseCommands (entity this)
 
prev prev prev prev prev best best best best best next next next next next void weapon_byid_handle (entity this, int number, int imp)
 
void weapon_group_handle (entity this, int number, int imp)
 Impulse map: More...
 
 X (1) X(2) X(3) X(4) X(5) X(6) X(7) X(8) X(9) X(0) void weapon_priority_handle(entity this
 
 X (0, prev) X(1
 
prev X (2, prev) X(3
 
prev prev X (4, prev) X(5
 
prev prev prev X (6, prev) X(7
 
prev prev prev prev X (8, prev) X(9
 
prev prev prev prev prev X (0, best) X(1
 
prev prev prev prev prev best X (2, best) X(3
 
prev prev prev prev prev best best X (4, best) X(5
 
prev prev prev prev prev best best best X (6, best) X(7
 
prev prev prev prev prev best best best best X (8, best) X(9
 
prev prev prev prev prev best best best best best X (0, next) X(1
 
prev prev prev prev prev best best best best best next X (2, next) X(3
 
prev prev prev prev prev best best best best best next next X (4, next) X(5
 
prev prev prev prev prev best best best best best next next next X (6, next) X(7
 
prev prev prev prev prev best best best best best next next next next X (8, next) X(9
 
 X (0) X(1) X(2) X(3) X(4) X(5) X(6) X(7) X(8) X(9) X(10) X(11) X(12) X(13) X(14) X(15) X(16) X(17) X(18) X(19) X(20) X(21) X(22) X(23) IMPULSE(weapon_next_byid)
 

Variables

int dir
 
int int int imp
 
int int number
 
entity vehicle
 

Macro Definition Documentation

◆ _IMPULSE

#define _IMPULSE (   id)
Value:
void id##_handle(entity this); \
STATIC_INIT_LATE(id) \
{ \
id.impulse_handle = id##_handle; \
} \
void id##_handle(entity this)
entity() spawn

Definition at line 24 of file impulse.qc.

◆ IMPULSE

#define IMPULSE (   id)    _IMPULSE(IMP_##id)

Definition at line 23 of file impulse.qc.

◆ X [1/4]

#define X (   i)
Value:
IMPULSE(weapon_group_##i) \
{ \
weapon_group_handle(this, i, IMP_weapon_group_##i.impulse); \
}
#define IMPULSE(id)
Definition: impulse.qc:23

Definition at line 167 of file impulse.qc.

Referenced by for(), ImpulseCommands(), and weapon_group_handle().

◆ X [2/4]

#define X (   i,
  dir 
)
Value:
IMPULSE(weapon_priority_##i##_##dir) \
{ \
noref int prev = -1; \
noref int best = 0; \
noref int next = +1; \
weapon_priority_handle(this, dir, i, IMP_weapon_priority_##i##_##dir.impulse); \
}
prev
Definition: all.qh:66
#define IMPULSE(id)
Definition: impulse.qc:23
next
Definition: all.qh:88
best
Definition: all.qh:77
int dir
Definition: impulse.qc:89

Definition at line 167 of file impulse.qc.

◆ X [3/4]

#define X (   i)
Value:
IMPULSE(weapon_byid_##i) \
{ \
weapon_byid_handle(this, i, IMP_weapon_byid_##i.impulse); \
}
#define IMPULSE(id)
Definition: impulse.qc:23

Definition at line 167 of file impulse.qc.

◆ X [4/4]

#define X (   id)    case IMP_##id.impulse:

Definition at line 167 of file impulse.qc.

Function Documentation

◆ for()

for ( )

Definition at line 97 of file impulse.qc.

References autocvar_g_weaponswitch_debug, best, CS_CVAR, next, prev, W_CycleWeapon(), weaponentities, and X.

Referenced by Dump_Weapon_Settings().

98  {
99  .entity weaponentity = weaponentities[slot];
100  W_CycleWeapon(this, CS_CVAR(this).cvar_cl_weaponpriorities[number], dir, weaponentity);
102  break;
103  }
int int number
Definition: impulse.qc:89
#define CS_CVAR(this)
Definition: state.qh:51
bool autocvar_g_weaponswitch_debug
Definition: selection.qh:7
entity weaponentities[MAX_WEAPONSLOTS]
Definition: weapon.qh:14
int dir
Definition: impulse.qc:89
void W_CycleWeapon(entity this, string weaponorder, float dir,.entity weaponentity)
Definition: selection.qc:302
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ if()

◆ IMPULSE() [1/22]

IMPULSE ( weapon_prev_byid  )

Definition at line 216 of file impulse.qc.

References autocvar_g_weaponswitch_debug, impulse, IS_DEAD, MAX_WEAPONSLOTS, vehicle, W_PreviousWeapon(), and weaponentities.

217 {
218  if (this.vehicle) return;
219  if (IS_DEAD(this))
220  {
221  this.impulse = IMP_weapon_prev_byid.impulse;
222  return;
223  }
224  for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
225  {
226  .entity weaponentity = weaponentities[slot];
227  W_PreviousWeapon(this, 0, weaponentity);
228 
230  break;
231  }
232 }
float impulse
Definition: progsdefs.qc:158
bool autocvar_g_weaponswitch_debug
Definition: selection.qh:7
const int MAX_WEAPONSLOTS
Definition: weapon.qh:13
#define IS_DEAD(s)
Definition: utils.qh:26
entity weaponentities[MAX_WEAPONSLOTS]
Definition: weapon.qh:14
entity vehicle
Definition: impulse.qc:21
void W_PreviousWeapon(entity this, float list,.entity weaponentity)
Definition: selection.qc:330
+ Here is the call graph for this function:

◆ IMPULSE() [2/22]

IMPULSE ( weapon_next_bygroup  )

Definition at line 234 of file impulse.qc.

References autocvar_g_weaponswitch_debug, impulse, IS_DEAD, MAX_WEAPONSLOTS, vehicle, W_NextWeapon(), and weaponentities.

235 {
236  if (this.vehicle) return;
237  if (IS_DEAD(this))
238  {
239  this.impulse = IMP_weapon_next_bygroup.impulse;
240  return;
241  }
242  for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
243  {
244  .entity weaponentity = weaponentities[slot];
245  W_NextWeapon(this, 1, weaponentity);
246 
248  break;
249  }
250 }
void W_NextWeapon(entity this, int list,.entity weaponentity)
Definition: selection.qc:319
float impulse
Definition: progsdefs.qc:158
bool autocvar_g_weaponswitch_debug
Definition: selection.qh:7
const int MAX_WEAPONSLOTS
Definition: weapon.qh:13
#define IS_DEAD(s)
Definition: utils.qh:26
entity weaponentities[MAX_WEAPONSLOTS]
Definition: weapon.qh:14
entity vehicle
Definition: impulse.qc:21
+ Here is the call graph for this function:

◆ IMPULSE() [3/22]

IMPULSE ( weapon_prev_bygroup  )

Definition at line 252 of file impulse.qc.

References autocvar_g_weaponswitch_debug, impulse, IS_DEAD, MAX_WEAPONSLOTS, vehicle, W_PreviousWeapon(), and weaponentities.

253 {
254  if (this.vehicle) return;
255  if (IS_DEAD(this))
256  {
257  this.impulse = IMP_weapon_prev_bygroup.impulse;
258  return;
259  }
260  for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
261  {
262  .entity weaponentity = weaponentities[slot];
263  W_PreviousWeapon(this, 1, weaponentity);
264 
266  break;
267  }
268 }
float impulse
Definition: progsdefs.qc:158
bool autocvar_g_weaponswitch_debug
Definition: selection.qh:7
const int MAX_WEAPONSLOTS
Definition: weapon.qh:13
#define IS_DEAD(s)
Definition: utils.qh:26
entity weaponentities[MAX_WEAPONSLOTS]
Definition: weapon.qh:14
entity vehicle
Definition: impulse.qc:21
void W_PreviousWeapon(entity this, float list,.entity weaponentity)
Definition: selection.qc:330
+ Here is the call graph for this function:

◆ IMPULSE() [4/22]

IMPULSE ( weapon_next_bypriority  )

Definition at line 270 of file impulse.qc.

References autocvar_g_weaponswitch_debug, impulse, IS_DEAD, MAX_WEAPONSLOTS, vehicle, W_NextWeapon(), and weaponentities.

271 {
272  if (this.vehicle) return;
273  if (IS_DEAD(this))
274  {
275  this.impulse = IMP_weapon_next_bypriority.impulse;
276  return;
277  }
278  for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
279  {
280  .entity weaponentity = weaponentities[slot];
281  W_NextWeapon(this, 2, weaponentity);
282 
284  break;
285  }
286 }
void W_NextWeapon(entity this, int list,.entity weaponentity)
Definition: selection.qc:319
float impulse
Definition: progsdefs.qc:158
bool autocvar_g_weaponswitch_debug
Definition: selection.qh:7
const int MAX_WEAPONSLOTS
Definition: weapon.qh:13
#define IS_DEAD(s)
Definition: utils.qh:26
entity weaponentities[MAX_WEAPONSLOTS]
Definition: weapon.qh:14
entity vehicle
Definition: impulse.qc:21
+ Here is the call graph for this function:

◆ IMPULSE() [5/22]

IMPULSE ( weapon_prev_bypriority  )

Definition at line 288 of file impulse.qc.

References autocvar_g_weaponswitch_debug, impulse, IS_DEAD, MAX_WEAPONSLOTS, vehicle, W_PreviousWeapon(), and weaponentities.

289 {
290  if (this.vehicle) return;
291  if (IS_DEAD(this))
292  {
293  this.impulse = IMP_weapon_prev_bypriority.impulse;
294  return;
295  }
296  for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
297  {
298  .entity weaponentity = weaponentities[slot];
299  W_PreviousWeapon(this, 2, weaponentity);
300 
302  break;
303  }
304 }
float impulse
Definition: progsdefs.qc:158
bool autocvar_g_weaponswitch_debug
Definition: selection.qh:7
const int MAX_WEAPONSLOTS
Definition: weapon.qh:13
#define IS_DEAD(s)
Definition: utils.qh:26
entity weaponentities[MAX_WEAPONSLOTS]
Definition: weapon.qh:14
entity vehicle
Definition: impulse.qc:21
void W_PreviousWeapon(entity this, float list,.entity weaponentity)
Definition: selection.qc:330
+ Here is the call graph for this function:

◆ IMPULSE() [6/22]

IMPULSE ( weapon_last  )

Definition at line 306 of file impulse.qc.

References autocvar_g_weaponswitch_debug, IS_DEAD, MAX_WEAPONSLOTS, vehicle, W_LastWeapon(), and weaponentities.

307 {
308  if (this.vehicle) return;
309  if (IS_DEAD(this)) return;
310  for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
311  {
312  .entity weaponentity = weaponentities[slot];
313  W_LastWeapon(this, weaponentity);
314 
316  break;
317  }
318 }
bool autocvar_g_weaponswitch_debug
Definition: selection.qh:7
const int MAX_WEAPONSLOTS
Definition: weapon.qh:13
#define IS_DEAD(s)
Definition: utils.qh:26
entity weaponentities[MAX_WEAPONSLOTS]
Definition: weapon.qh:14
entity vehicle
Definition: impulse.qc:21
void W_LastWeapon(entity this,.entity weaponentity)
Definition: selection.qc:341
+ Here is the call graph for this function:

◆ IMPULSE() [7/22]

IMPULSE ( weapon_best  )

Definition at line 320 of file impulse.qc.

References autocvar_g_weaponswitch_debug, IS_DEAD, MAX_WEAPONSLOTS, vehicle, w_getbestweapon, W_SwitchWeapon(), and weaponentities.

321 {
322  if (this.vehicle) return;
323  if (IS_DEAD(this)) return;
324  for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
325  {
326  .entity weaponentity = weaponentities[slot];
327  W_SwitchWeapon(this, w_getbestweapon(this, weaponentity), weaponentity);
328 
330  break;
331  }
332 }
#define w_getbestweapon(ent, wepent)
Definition: selection.qh:23
bool autocvar_g_weaponswitch_debug
Definition: selection.qh:7
const int MAX_WEAPONSLOTS
Definition: weapon.qh:13
#define IS_DEAD(s)
Definition: utils.qh:26
bool W_SwitchWeapon(entity this, Weapon w,.entity weaponentity)
Definition: selection.qc:272
entity weaponentities[MAX_WEAPONSLOTS]
Definition: weapon.qh:14
entity vehicle
Definition: impulse.qc:21
+ Here is the call graph for this function:

◆ IMPULSE() [8/22]

IMPULSE ( weapon_drop  )

Definition at line 334 of file impulse.qc.

References autocvar_g_weaponswitch_debug, IS_DEAD, MAX_WEAPONSLOTS, movedir, v_forward, v_right, vector(), vehicle, velocity, W_CalculateProjectileVelocity(), W_DualWielding(), W_ThrowWeapon(), and weaponentities.

335 {
336  if (this.vehicle) return;
337  if (IS_DEAD(this)) return;
338  bool is_dualwielding = W_DualWielding(this);
339  for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
340  {
341  .entity weaponentity = weaponentities[slot];
342  vector md = this.(weaponentity).movedir;
343  vector vecs = ((md.x > 0) ? md : '0 0 0');
344  vector dv = v_right * -vecs.y;
345  if(!is_dualwielding)
346  dv = '0 0 0'; // don't override!
347  W_ThrowWeapon(this, weaponentity, W_CalculateProjectileVelocity(this, this.velocity, v_forward * 750, false), dv, true);
348 
350  break; // in this mode, the off-hand weapon is selected based on the primary weapon, don't drop it twice!
351  }
352 }
void W_ThrowWeapon(entity this,.entity weaponentity, vector velo, vector delta, float doreduce)
Definition: throwing.qc:153
vector movedir
Definition: progsdefs.qc:203
bool autocvar_g_weaponswitch_debug
Definition: selection.qh:7
bool W_DualWielding(entity player)
Definition: common.qc:20
const int MAX_WEAPONSLOTS
Definition: weapon.qh:13
#define IS_DEAD(s)
Definition: utils.qh:26
vector(float skel, float bonenum) _skel_get_boneabs_hidden
vector v_right
Definition: csprogsdefs.qc:31
entity weaponentities[MAX_WEAPONSLOTS]
Definition: weapon.qh:14
vector W_CalculateProjectileVelocity(entity actor, vector pvelocity, vector mvelocity, float forceAbsolute)
Definition: tracing.qc:169
entity vehicle
Definition: impulse.qc:21
vector velocity
Definition: csprogsdefs.qc:103
vector v_forward
Definition: csprogsdefs.qc:31
+ Here is the call graph for this function:

◆ IMPULSE() [9/22]

IMPULSE ( weapon_reload  )

Definition at line 354 of file impulse.qc.

References entity(), IS_DEAD, MAX_WEAPONSLOTS, vehicle, weaponentities, and weaponLocked().

355 {
356  if (this.vehicle) return;
357  if (IS_DEAD(this)) return;
358  if (weaponLocked(this)) return;
359  entity actor = this;
360  for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
361  {
362  .entity weaponentity = weaponentities[slot];
363  Weapon w = this.(weaponentity).m_weapon;
364  w.wr_reload(w, actor, weaponentity);
365 
366  // allow reloading all active slots?
367  //if(autocvar_g_weaponswitch_debug != 1)
368  //break;
369  }
370 }
entity() spawn
bool weaponLocked(entity player)
const int MAX_WEAPONSLOTS
Definition: weapon.qh:13
#define IS_DEAD(s)
Definition: utils.qh:26
entity weaponentities[MAX_WEAPONSLOTS]
Definition: weapon.qh:14
entity vehicle
Definition: impulse.qc:21
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
Definition: weapon.qh:41
+ Here is the call graph for this function:

◆ IMPULSE() [10/22]

IMPULSE ( use  )

Definition at line 410 of file impulse.qc.

References PlayerUseKey().

411 {
412  PlayerUseKey(this);
413 }
void PlayerUseKey(entity this)
Definition: client.qc:2349
+ Here is the call graph for this function:

◆ IMPULSE() [11/22]

IMPULSE ( waypoint_personal_here  )

Definition at line 415 of file impulse.qc.

References entity(), origin, and sprint().

416 {
417  entity wp = WaypointSprite_DeployPersonal(WP_Waypoint, this, this.origin, RADARICON_WAYPOINT);
418  if (wp) WaypointSprite_Ping(wp);
419  sprint(this, "personal waypoint spawned at location\n");
420 }
entity() spawn
origin
Definition: ent_cs.qc:114
+ Here is the call graph for this function:

◆ IMPULSE() [12/22]

IMPULSE ( waypoint_personal_crosshair  )

Definition at line 422 of file impulse.qc.

References entity(), sprint(), trace_endpos, and WarpZone_crosshair_trace().

423 {
425  entity wp = WaypointSprite_DeployPersonal(WP_Waypoint, this, trace_endpos, RADARICON_WAYPOINT);
426  if (wp) WaypointSprite_Ping(wp);
427  sprint(this, "personal waypoint spawned at crosshair\n");
428 }
entity() spawn
vector trace_endpos
Definition: csprogsdefs.qc:37
void WarpZone_crosshair_trace(entity pl)
Definition: tracing.qc:544
+ Here is the call graph for this function:

◆ IMPULSE() [13/22]

IMPULSE ( waypoint_personal_death  )

Definition at line 430 of file impulse.qc.

References death_origin, entity(), and sprint().

431 {
432  if (!this.death_origin) return;
433  entity wp = WaypointSprite_DeployPersonal(WP_Waypoint, this, this.death_origin, RADARICON_WAYPOINT);
434  if (wp) WaypointSprite_Ping(wp);
435  sprint(this, "personal waypoint spawned at death location\n");
436 }
entity() spawn
vector death_origin
Definition: damage.qh:70
+ Here is the call graph for this function:

◆ IMPULSE() [14/22]

IMPULSE ( waypoint_here_follow  )

Definition at line 438 of file impulse.qc.

References entity(), IS_DEAD, MUTATOR_CALLHOOK, sprint(), and teamplay.

439 {
440  if (!teamplay) return;
441  if (IS_DEAD(this)) return;
442  if (!MUTATOR_CALLHOOK(HelpMePing, this))
443  {
444  entity wp = WaypointSprite_Attach(WP_Helpme, this, true, RADARICON_HELPME);
445  if (!wp) WaypointSprite_HelpMePing(this.waypointsprite_attachedforcarrier);
446  else WaypointSprite_Ping(wp);
447  }
448  sprint(this, "HELP ME attached\n");
449 }
entity() spawn
float teamplay
Definition: progsdefs.qc:31
#define IS_DEAD(s)
Definition: utils.qh:26
#define MUTATOR_CALLHOOK(id,...)
Definition: base.qh:140
+ Here is the call graph for this function:

◆ IMPULSE() [15/22]

IMPULSE ( waypoint_here_here  )

Definition at line 451 of file impulse.qc.

References entity(), origin, and sprint().

452 {
453  entity wp = WaypointSprite_DeployFixed(WP_Here, false, this, this.origin, RADARICON_HERE);
454  if (wp) WaypointSprite_Ping(wp);
455  sprint(this, "HERE spawned at location\n");
456 }
entity() spawn
origin
Definition: ent_cs.qc:114
+ Here is the call graph for this function:

◆ IMPULSE() [16/22]

IMPULSE ( waypoint_here_crosshair  )

Definition at line 458 of file impulse.qc.

References entity(), sprint(), trace_endpos, and WarpZone_crosshair_trace_plusvisibletriggers().

459 {
461  entity wp = WaypointSprite_DeployFixed(WP_Here, false, this, trace_endpos, RADARICON_HERE);
462  if (wp) WaypointSprite_Ping(wp);
463  sprint(this, "HERE spawned at crosshair\n");
464 }
entity() spawn
vector trace_endpos
Definition: csprogsdefs.qc:37
void WarpZone_crosshair_trace_plusvisibletriggers(entity pl)
Definition: tracing.qc:518
+ Here is the call graph for this function:

◆ IMPULSE() [17/22]

IMPULSE ( waypoint_here_death  )

Definition at line 466 of file impulse.qc.

References death_origin, entity(), and sprint().

467 {
468  if (!this.death_origin) return;
469  entity wp = WaypointSprite_DeployFixed(WP_Here, false, this, this.death_origin, RADARICON_HERE);
470  if (wp) WaypointSprite_Ping(wp);
471  sprint(this, "HERE spawned at death location\n");
472 }
entity() spawn
vector death_origin
Definition: damage.qh:70
+ Here is the call graph for this function:

◆ IMPULSE() [18/22]

IMPULSE ( waypoint_danger_here  )

Definition at line 474 of file impulse.qc.

References entity(), origin, and sprint().

475 {
476  entity wp = WaypointSprite_DeployFixed(WP_Danger, false, this, this.origin, RADARICON_DANGER);
477  if (wp) WaypointSprite_Ping(wp);
478  sprint(this, "DANGER spawned at location\n");
479 }
entity() spawn
origin
Definition: ent_cs.qc:114
+ Here is the call graph for this function:

◆ IMPULSE() [19/22]

IMPULSE ( waypoint_danger_crosshair  )

Definition at line 481 of file impulse.qc.

References entity(), sprint(), trace_endpos, and WarpZone_crosshair_trace().

482 {
484  entity wp = WaypointSprite_DeployFixed(WP_Danger, false, this, trace_endpos, RADARICON_DANGER);
485  if (wp) WaypointSprite_Ping(wp);
486  sprint(this, "DANGER spawned at crosshair\n");
487 }
entity() spawn
vector trace_endpos
Definition: csprogsdefs.qc:37
void WarpZone_crosshair_trace(entity pl)
Definition: tracing.qc:544
+ Here is the call graph for this function:

◆ IMPULSE() [20/22]

IMPULSE ( waypoint_danger_death  )

Definition at line 489 of file impulse.qc.

References death_origin, entity(), and sprint().

490 {
491  if (!this.death_origin) return;
492  entity wp = WaypointSprite_DeployFixed(WP_Danger, false, this, this.death_origin, RADARICON_DANGER);
493  if (wp) WaypointSprite_Ping(wp);
494  sprint(this, "DANGER spawned at death location\n");
495 }
entity() spawn
vector death_origin
Definition: damage.qh:70
+ Here is the call graph for this function:

◆ IMPULSE() [21/22]

IMPULSE ( waypoint_clear_personal  )

Definition at line 497 of file impulse.qc.

References autocvar_g_allow_checkpoints, ClientKill(), g_cts, g_race, NULL, personal, and sprint().

498 {
499  WaypointSprite_ClearPersonal(this);
500  if (this.personal)
501  {
502  delete(this.personal);
503  this.personal = NULL;
504 
506  ClientKill(this);
507  }
508  sprint(this, "personal waypoint cleared\n");
509 }
void ClientKill(entity this)
Definition: clientkill.qc:208
entity personal
Definition: cheats.qh:23
#define g_cts
Definition: cts.qh:36
#define g_race
Definition: race.qh:46
bool autocvar_g_allow_checkpoints
Definition: race.qh:3
#define NULL
Definition: post.qh:17
+ Here is the call graph for this function:

◆ IMPULSE() [22/22]

IMPULSE ( waypoint_clear  )

Definition at line 511 of file impulse.qc.

References autocvar_g_allow_checkpoints, ClientKill(), g_cts, g_race, NULL, personal, and sprint().

512 {
513  WaypointSprite_ClearOwned(this);
514  if (this.personal)
515  {
516  delete(this.personal);
517  this.personal = NULL;
519  ClientKill(this);
520  }
521  sprint(this, "all waypoints cleared\n");
522 }
void ClientKill(entity this)
Definition: clientkill.qc:208
entity personal
Definition: cheats.qh:23
#define g_cts
Definition: cts.qh:36
#define g_race
Definition: race.qh:46
bool autocvar_g_allow_checkpoints
Definition: race.qh:3
#define NULL
Definition: post.qh:17
+ Here is the call graph for this function:

◆ ImpulseCommands()

void ImpulseCommands ( entity  this)

Definition at line 372 of file impulse.qc.

References CheatImpulse(), CS(), FOREACH, MinigameImpulse(), round_handler_IsActive, round_handler_IsRoundStarted, TIMEOUT_ACTIVE, use, vehicle_impulse(), and X.

Referenced by ctf_FlagThink(), PlayerPostThink(), and PutPlayerInServer().

373 {
374  if (game_stopped) return;
375 
376  int imp = CS(this).impulse;
377  if (!imp) return;
378  CS(this).impulse = 0;
379 
380  if (MinigameImpulse(this, imp)) return;
381 
382  if (timeout_status == TIMEOUT_ACTIVE) return; // don't allow any impulses while the game is paused
383 
385  {
386  // impulses forbidden while waiting for the start of a round
387  #define X(id) case IMP_##id.impulse:
388  switch (imp)
389  {
390  X(weapon_drop)
391  X(weapon_reload)
392  X(use)
393  return;
394  }
395 #undef X
396  }
397 
398  if (vehicle_impulse(this, imp)) return;
399 
400  if (CheatImpulse(this, imp)) return;
401 
402  FOREACH(IMPULSES, it.impulse == imp, {
403  void(entity) f = it.impulse_handle;
404  if (!f) continue;
405  f(this);
406  return;
407  });
408 }
int int int imp
Definition: impulse.qc:90
#define round_handler_IsActive()
#define X(i)
Definition: impulse.qc:167
float CheatImpulse(entity this, int imp)
Definition: cheats.qc:130
ClientState CS(Client this)
Definition: state.qh:47
bool vehicle_impulse(entity this, int imp)
Definition: sv_vehicles.qc:921
const float TIMEOUT_ACTIVE
Definition: common.qh:49
#define round_handler_IsRoundStarted()
bool MinigameImpulse(entity this, int imp)
#define use
Definition: csprogsdefs.qh:50
#define FOREACH(list, cond, body)
Definition: iter.qh:19
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ weapon_byid_handle()

prev prev prev prev prev best best best best best next next next next next void weapon_byid_handle ( entity  this,
int  number,
int  imp 
)

Definition at line 150 of file impulse.qc.

References autocvar_g_weaponswitch_debug, imp, impulse, IS_DEAD, MAX_WEAPONSLOTS, REGISTRY_GET, vehicle, W_SwitchWeapon_TryOthers(), weaponentities, and WEP_FIRST.

151 {
152  if (this.vehicle) return;
153  if (IS_DEAD(this))
154  {
155  this.impulse = imp;
156  return;
157  }
158  for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
159  {
160  .entity weaponentity = weaponentities[slot];
161  W_SwitchWeapon_TryOthers(this, REGISTRY_GET(Weapons, WEP_FIRST + number), weaponentity);
163  break;
164  }
165 }
int int int imp
Definition: impulse.qc:90
const int WEP_FIRST
Definition: all.qh:304
int int number
Definition: impulse.qc:89
void W_SwitchWeapon_TryOthers(entity this, Weapon w,.entity weaponentity)
Definition: selection.qc:296
#define REGISTRY_GET(id, i)
Definition: registry.qh:43
float impulse
Definition: progsdefs.qc:158
bool autocvar_g_weaponswitch_debug
Definition: selection.qh:7
const int MAX_WEAPONSLOTS
Definition: weapon.qh:13
#define IS_DEAD(s)
Definition: utils.qh:26
entity weaponentities[MAX_WEAPONSLOTS]
Definition: weapon.qh:14
entity vehicle
Definition: impulse.qc:21
+ Here is the call graph for this function:

◆ weapon_group_handle()

void weapon_group_handle ( entity  this,
int  number,
int  imp 
)

Impulse map:

0 reserved (no input)

99: loaded

140: moving clone 141: ctf speedrun 142: fixed clone 143: emergency teleport 148: unfairly eliminate

TODO: 200 to 209: prev weapon shortcuts 210 to 219: best weapon shortcuts 220 to 229: next weapon shortcuts 230 to 253: individual weapons (up to 24)

Definition at line 54 of file impulse.qc.

References autocvar_g_weaponswitch_debug, imp, impulse, IS_DEAD, MAX_WEAPONSLOTS, W_NextWeaponOnImpulse(), weaponentities, and X.

55 {
56  if (IS_DEAD(this))
57  {
58  this.impulse = imp;
59  return;
60  }
61  for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
62  {
63  .entity weaponentity = weaponentities[slot];
64  W_NextWeaponOnImpulse(this, number, weaponentity);
66  break;
67  }
68 }
int int int imp
Definition: impulse.qc:90
int int number
Definition: impulse.qc:89
float impulse
Definition: progsdefs.qc:158
bool autocvar_g_weaponswitch_debug
Definition: selection.qh:7
const int MAX_WEAPONSLOTS
Definition: weapon.qh:13
#define IS_DEAD(s)
Definition: utils.qh:26
void W_NextWeaponOnImpulse(entity this, float imp,.entity weaponentity)
Definition: selection.qc:310
entity weaponentities[MAX_WEAPONSLOTS]
Definition: weapon.qh:14
+ Here is the call graph for this function:

◆ X() [1/17]

X ( )

◆ X() [2/17]

X ( ,
prev   
)

◆ X() [3/17]

prev X ( ,
prev   
)

◆ X() [4/17]

prev prev X ( ,
prev   
)

◆ X() [5/17]

prev prev prev X ( ,
prev   
)

◆ X() [6/17]

prev prev prev prev X ( ,
prev   
)

◆ X() [7/17]

prev prev prev prev prev X ( ,
best   
)

◆ X() [8/17]

prev prev prev prev prev best X ( ,
best   
)

◆ X() [9/17]

prev prev prev prev prev best best X ( ,
best   
)

◆ X() [10/17]

prev prev prev prev prev best best best X ( ,
best   
)

◆ X() [11/17]

prev prev prev prev prev best best best best X ( ,
best   
)

◆ X() [12/17]

◆ X() [13/17]

◆ X() [14/17]

◆ X() [15/17]

◆ X() [16/17]

◆ X() [17/17]

X ( )

Definition at line 172 of file impulse.qc.

References autocvar_g_weaponswitch_debug, impulse, IS_DEAD, MAX_WEAPONSLOTS, vehicle, W_NextWeapon(), and weaponentities.

199 {
200  if (this.vehicle) return;
201  if (IS_DEAD(this))
202  {
203  this.impulse = IMP_weapon_next_byid.impulse;
204  return;
205  }
206  for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
207  {
208  .entity weaponentity = weaponentities[slot];
209  W_NextWeapon(this, 0, weaponentity);
210 
212  break;
213  }
214 }
void W_NextWeapon(entity this, int list,.entity weaponentity)
Definition: selection.qc:319
float impulse
Definition: progsdefs.qc:158
bool autocvar_g_weaponswitch_debug
Definition: selection.qh:7
const int MAX_WEAPONSLOTS
Definition: weapon.qh:13
#define IS_DEAD(s)
Definition: utils.qh:26
entity weaponentities[MAX_WEAPONSLOTS]
Definition: weapon.qh:14
entity vehicle
Definition: impulse.qc:21
+ Here is the call graph for this function:

Variable Documentation

◆ dir

◆ imp

int int int imp
Initial value:
{
if (this.vehicle) return
entity vehicle
Definition: impulse.qc:21

Definition at line 90 of file impulse.qc.

Referenced by if(), MapVote_InputEvent(), MapVote_MoveDown(), MapVote_MoveLeft(), MapVote_MoveRight(), MapVote_MoveUp(), STATIC_INIT(), weapon_byid_handle(), and weapon_group_handle().

◆ number

◆ vehicle