Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
doublejump.qc File Reference
#include "doublejump.qh"
#include <server/antilag.qh>
#include <common/physics/player.qh>
Include dependency graph for doublejump.qc:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define PHYS_DOUBLEJUMP(s)

Functions

 MUTATOR_HOOKFUNCTION (doublejump, PlayerJump)
 REGISTER_MUTATOR (doublejump, autocvar_sv_doublejump)

Macro Definition Documentation

◆ PHYS_DOUBLEJUMP

#define PHYS_DOUBLEJUMP ( s)
Value:
STAT(DOUBLEJUMP, s)
#define STAT(...)
Definition stats.qh:82

Definition at line 15 of file doublejump.qc.

Referenced by MUTATOR_HOOKFUNCTION().

Function Documentation

◆ MUTATOR_HOOKFUNCTION()

MUTATOR_HOOKFUNCTION ( doublejump ,
PlayerJump  )

Definition at line 18 of file doublejump.qc.

19{
20 entity player = M_ARGV(0, entity);
21
22 if (PHYS_DOUBLEJUMP(player))
23 {
24 tracebox(player.origin + '0 0 0.01', player.mins, player.maxs, player.origin - '0 0 0.01', MOVE_NORMAL, player);
26 {
27 M_ARGV(2, bool) = true;
28
29 // we MUST clip velocity here!
30 float f = player.velocity * trace_plane_normal;
31 if (f < 0)
32 player.velocity -= f * trace_plane_normal;
33 }
34 }
35}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define M_ARGV(x, type)
Definition events.qh:17
const float MOVE_NORMAL
float trace_fraction
vector trace_plane_normal
#define PHYS_DOUBLEJUMP(s)
Definition doublejump.qc:15

References entity(), M_ARGV, MOVE_NORMAL, PHYS_DOUBLEJUMP, PlayerJump(), trace_fraction, and trace_plane_normal.

◆ REGISTER_MUTATOR()

REGISTER_MUTATOR ( doublejump ,
autocvar_sv_doublejump  )