]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/doublejump/doublejump.qc
Cleanse the physics hooks
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / doublejump / doublejump.qc
index 144e87ae8ef691efa3617680a801c63a8bd81f48..d490ecaaff364d71ad3bc5511c5fb734a2f1cce2 100644 (file)
@@ -15,21 +15,21 @@ REGISTER_MUTATOR(doublejump, true);
 
 MUTATOR_HOOKFUNCTION(doublejump, PlayerJump)
 {
-    SELFPARAM();
-       if (PHYS_DOUBLEJUMP(self))
+    entity player = M_ARGV(0, entity);
+
+       if (PHYS_DOUBLEJUMP(player))
        {
-               tracebox(self.origin + '0 0 0.01', self.mins, self.maxs, self.origin - '0 0 0.01', MOVE_NORMAL, self);
+               tracebox(player.origin + '0 0 0.01', player.mins, player.maxs, player.origin - '0 0 0.01', MOVE_NORMAL, player);
                if (trace_fraction < 1 && trace_plane_normal_z > 0.7)
                {
-                       player_multijump = true;
+                       M_ARGV(2, bool) = true;
 
                        // we MUST clip velocity here!
-                       float f = self.velocity * trace_plane_normal;
+                       float f = player.velocity * trace_plane_normal;
                        if (f < 0)
-                               self.velocity -= f * trace_plane_normal;
+                               player.velocity -= f * trace_plane_normal;
                }
        }
-       return false;
 }
 
 #endif