]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/mutator_multijump.qc
Improve the distribution of icons in the HUD weapons panel
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / mutator_multijump.qc
index 50741dc20b4f3cadd1d2d75ff1b0ce1f5180a4c5..868ddf246e0b5f0c88c93e7b594e412238110df7 100644 (file)
@@ -4,12 +4,7 @@
 MUTATOR_HOOKFUNCTION(multijump_PlayerPhysics)
 {
        if(self.flags & FL_ONGROUND)
-       {
-               if (autocvar_g_multijump > 0)
-                       self.multijump_count = 0;
-               else
-                       self.multijump_count = -2; // the cvar value for infinite jumps is -1, so this needs to be smaller
-       }
+               self.multijump_count = 0;
 
        return FALSE;
 }
@@ -21,7 +16,7 @@ MUTATOR_HOOKFUNCTION(multijump_PlayerJump)
        else
                self.multijump_ready = FALSE;
 
-       if(!player_multijump && self.multijump_ready && self.multijump_count < autocvar_g_multijump && self.velocity_z > autocvar_g_multijump_speed)
+       if(!player_multijump && self.multijump_ready && (autocvar_g_multijump == -1 || self.multijump_count < autocvar_g_multijump) && self.velocity_z > autocvar_g_multijump_speed)
        {
                if (autocvar_g_multijump)
                {
@@ -55,8 +50,7 @@ MUTATOR_HOOKFUNCTION(multijump_PlayerJump)
                                        self.velocity_y = wishdir_y * curspeed;
                                        // keep velocity_z unchanged!
                                }
-                               if (autocvar_g_multijump > 0)
-                                       self.multijump_count += 1;
+                               self.multijump_count += 1;
                        }
                }
                self.multijump_ready = FALSE; // require releasing and pressing the jump button again for the next jump