Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
doublejump.qc
Go to the documentation of this file.
1#include "doublejump.qh"
2
3#ifdef GAMEQC
4#ifdef SVQC
5 #include <server/antilag.qh>
6#endif
8
9#ifdef SVQC
11#elif defined(CSQC)
12REGISTER_MUTATOR(doublejump, true);
13#endif
14
15#define PHYS_DOUBLEJUMP(s) STAT(DOUBLEJUMP, s)
16
17
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}
36#endif
#define REGISTER_MUTATOR(...)
Definition base.qh:295
#define MUTATOR_HOOKFUNCTION(...)
Definition base.qh:335
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define M_ARGV(x, type)
Definition events.qh:17
bool PlayerJump(entity this)
Definition player.qc:378
const float MOVE_NORMAL
float trace_fraction
vector trace_plane_normal
#define PHYS_DOUBLEJUMP(s)
Definition doublejump.qc:15
bool autocvar_sv_doublejump
Definition doublejump.qh:4