Xonotic
impulse.qh File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void ImpulseCommands (entity this)
 

Function Documentation

◆ 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: