]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/doublejump/doublejump.qc
take3: format 903 files
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / doublejump / doublejump.qc
index cc60ccc1fd8a9bccf1a9006ca0b46a86796d35f8..19e24b2dc443b45e3e10835e414c04571ab66989 100644 (file)
@@ -2,7 +2,7 @@
 
 #ifdef GAMEQC
 #ifdef SVQC
-       #include <server/antilag.qh>
+#include <server/antilag.qh>
 #endif
 #include <common/physics/player.qh>
 
@@ -12,24 +12,23 @@ REGISTER_MUTATOR(doublejump, autocvar_sv_doublejump);
 REGISTER_MUTATOR(doublejump, true);
 #endif
 
-#define PHYS_DOUBLEJUMP(s)                     STAT(DOUBLEJUMP, s)
+#define PHYS_DOUBLEJUMP(s) STAT(DOUBLEJUMP, s)
 
 
 MUTATOR_HOOKFUNCTION(doublejump, PlayerJump)
 {
-    entity player = M_ARGV(0, entity);
+       entity player = M_ARGV(0, entity);
 
-       if (PHYS_DOUBLEJUMP(player))
-       {
+       if (PHYS_DOUBLEJUMP(player)) {
                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)
-               {
+               if (trace_fraction < 1 && trace_plane_normal_z > 0.7) {
                        M_ARGV(2, bool) = true;
 
                        // we MUST clip velocity here!
                        float f = player.velocity * trace_plane_normal;
-                       if (f < 0)
+                       if (f < 0) {
                                player.velocity -= f * trace_plane_normal;
+                       }
                }
        }
 }