3 #include <server/antilag.qh>
5 #include <common/physics/player.qh>
8 REGISTER_MUTATOR(doublejump, autocvar_sv_doublejump);
10 REGISTER_MUTATOR(doublejump, true);
13 #define PHYS_DOUBLEJUMP(s) STAT(DOUBLEJUMP, s)
16 MUTATOR_HOOKFUNCTION(doublejump, PlayerJump)
18 entity player = M_ARGV(0, entity);
20 if (PHYS_DOUBLEJUMP(player))
22 tracebox(player.origin + '0 0 0.01', player.mins, player.maxs, player.origin - '0 0 0.01', MOVE_NORMAL, player);
23 if (trace_fraction < 1 && trace_plane_normal_z > 0.7)
25 M_ARGV(2, bool) = true;
27 // we MUST clip velocity here!
28 float f = player.velocity * trace_plane_normal;
30 player.velocity -= f * trace_plane_normal;