]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
If we teleported above the ground, require touching the ground again to multi-jump...
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 16 Apr 2011 13:43:07 +0000 (16:43 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 16 Apr 2011 13:43:07 +0000 (16:43 +0300)
data/qcsrc/server/cl_physics.qc

index f917d8b611370a71971c7ceff2afafdc55bab9d2..2c28409161ef0dfca59dab7309326cc4c0bfd996 100644 (file)
@@ -32,6 +32,7 @@ float sv_warsowbunny_backtosideratio;
 .float multijump_count;\r
 .float multijump_ready;\r
 .float prevjumpbutton;\r
+.float prevlastteleporttime;\r
 \r
 /*\r
 =============\r
@@ -68,7 +69,14 @@ void PlayerJump (void)
 \r
        if (cvar("g_multijump"))\r
        {\r
-               if (self.prevjumpbutton == FALSE && !(self.flags & FL_ONGROUND)) // jump button pressed this frame and we are in midair\r
+               if(self.prevlastteleporttime != self.lastteleporttime)\r
+               {\r
+                       // if we teleported above the ground, require touching the ground again to multi-jump\r
+                       self.multijump_ready = FALSE;\r
+                       if(self.flags & FL_ONGROUND)\r
+                               self.prevlastteleporttime = self.lastteleporttime;\r
+               }\r
+               else if (self.prevjumpbutton == FALSE && !(self.flags & FL_ONGROUND)) // jump button pressed this frame and we are in midair\r
                        self.multijump_ready = TRUE;  // this is necessary to check that we released the jump button and pressed it again\r
                else\r
                        self.multijump_ready = FALSE;\r