From d55b0d4835ab889437fcba8adcde9eb5423770a3 Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Sat, 16 Apr 2011 16:43:07 +0300 Subject: [PATCH] If we teleported above the ground, require touching the ground again to multi-jump. Else we can multi-jump immediately at the moment of spawning / teleporting. --- data/qcsrc/server/cl_physics.qc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/data/qcsrc/server/cl_physics.qc b/data/qcsrc/server/cl_physics.qc index f917d8b6..2c284091 100644 --- a/data/qcsrc/server/cl_physics.qc +++ b/data/qcsrc/server/cl_physics.qc @@ -32,6 +32,7 @@ float sv_warsowbunny_backtosideratio; .float multijump_count; .float multijump_ready; .float prevjumpbutton; +.float prevlastteleporttime; /* ============= @@ -68,7 +69,14 @@ void PlayerJump (void) if (cvar("g_multijump")) { - if (self.prevjumpbutton == FALSE && !(self.flags & FL_ONGROUND)) // jump button pressed this frame and we are in midair + if(self.prevlastteleporttime != self.lastteleporttime) + { + // if we teleported above the ground, require touching the ground again to multi-jump + self.multijump_ready = FALSE; + if(self.flags & FL_ONGROUND) + self.prevlastteleporttime = self.lastteleporttime; + } + else if (self.prevjumpbutton == FALSE && !(self.flags & FL_ONGROUND)) // jump button pressed this frame and we are in midair self.multijump_ready = TRUE; // this is necessary to check that we released the jump button and pressed it again else self.multijump_ready = FALSE; -- 2.39.2