From: Rudolf Polzer Date: Sun, 11 Sep 2011 12:47:17 +0000 (+0200) Subject: sv_doublejump: clip velocity when landing (fixes sticking-to-floor bug) X-Git-Tag: xonotic-v0.6.0~40^2~151 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6363d7d1cd87a8ad870453195ca9b2ee398830b6;p=xonotic%2Fxonotic-data.pk3dir.git sv_doublejump: clip velocity when landing (fixes sticking-to-floor bug) --- diff --git a/qcsrc/server/cl_physics.qc b/qcsrc/server/cl_physics.qc index b10c88d49..7d14fbdae 100644 --- a/qcsrc/server/cl_physics.qc +++ b/qcsrc/server/cl_physics.qc @@ -34,7 +34,15 @@ void PlayerJump (void) { tracebox(self.origin + '0 0 0.01', self.mins, self.maxs, self.origin - '0 0 0.01', MOVE_NORMAL, self); if (trace_fraction < 1 && trace_plane_normal_z > 0.7) + { doublejump = TRUE; + + // we MUST clip velocity here! + float f; + f = self.velocity * trace_plane_normal; + if(f < 0) + self.velocity -= f * trace_plane_normal; + } } mjumpheight = autocvar_sv_jumpvelocity;