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)
19 if (PHYS_DOUBLEJUMP(self))
21 tracebox(self.origin + '0 0 0.01', self.mins, self.maxs, self.origin - '0 0 0.01', MOVE_NORMAL, self);
22 if (trace_fraction < 1 && trace_plane_normal_z > 0.7)
24 player_multijump = true;
26 // we MUST clip velocity here!
27 float f = self.velocity * trace_plane_normal;
29 self.velocity -= f * trace_plane_normal;