Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
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 371 of file impulse.qc.

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

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

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