fix doublejump speedcap to properly refuse the jump
authordiv0 <div0@f962a42d-fe04-0410-a3ab-8c8b0445ebaa>
Sun, 7 Feb 2010 13:59:42 +0000 (13:59 +0000)
committerdiv0 <div0@f962a42d-fe04-0410-a3ab-8c8b0445ebaa>
Sun, 7 Feb 2010 13:59:42 +0000 (13:59 +0000)
git-svn-id: svn://svn.icculus.org/nexuiz/trunk@8624 f962a42d-fe04-0410-a3ab-8c8b0445ebaa

data/qcsrc/server/cl_physics.qc

index 08e7e41..67c8d7d 100644 (file)
@@ -89,20 +89,24 @@ void PlayerJump (void)
                mjumpheight = mjumpheight * cvar("g_minstagib_speed_jumpheight");
        }
 
+       if(self.velocity_z >= cvar("sv_doublejump_speedcap") && cvar("sv_doublejump_speedcap")) // try to "fix" the crazy stair jumps by limiting at which z-axis speeds you can perform a doublejump
+               return; // refuse the jump
+
        if(!(self.lastflags & FL_ONGROUND))
        {
                if(cvar("speedmeter"))
                        dprint(strcat("landing velocity: ", vtos(self.velocity), " (abs: ", ftos(vlen(self.velocity)), ")\n"));
                if(self.lastground < time - 0.3)
-                       self.velocity = self.velocity * (1 - cvar("sv_friction_on_land"));
+               {
+                       self.velocity_x *= (1 - cvar("sv_friction_on_land"));
+                       self.velocity_y *= (1 - cvar("sv_friction_on_land"));
+               }
                if(self.jumppadcount > 1)
                        dprint(strcat(ftos(self.jumppadcount), "x jumppad combo\n"));
                self.jumppadcount = 0;
        }
 
-       if(self.velocity_z < cvar("sv_doublejump_speedcap") || !cvar("sv_doublejump_speedcap")) // try to "fix" the crazy stair jumps by limiting at which z-axis speeds you can perform a doublejump
-               self.velocity_z = self.velocity_z + mjumpheight;
-
+       self.velocity_z = self.velocity_z + mjumpheight;
        self.oldvelocity_z = self.velocity_z;
 
        self.flags &~= FL_ONGROUND;