]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_input.c
fix another canjump tracking bug; STILL not good
[xonotic/darkplaces.git] / cl_input.c
index d357c115cffdf6d2f0d46d4d97053fb915325ebb..fee3b1df1ee66735a1f7b1de6097a74ea3799d06 100644 (file)
@@ -1329,7 +1329,7 @@ void CL_ClientMovement_Physics_Walk(cl_clientmovement_state_t *s)
        // released at least once since the last jump
        if (s->cmd.jump)
        {
-               if (s->onground && (s->cmd.canjump || !cl_movement_track_canjump.integer)) // FIXME remove this cvar again when canjump logic actually works, or maybe keep it for mods that allow "pogo-ing"
+               if (s->onground && (s->cmd.canjump || !cl_movement_track_canjump.integer))
                {
                        s->velocity[2] += cl.movevars_jumpvelocity;
                        s->onground = false;
@@ -1610,7 +1610,6 @@ void CL_ClientMovement_Replay(void)
                        s.cmd = cl.movecmd[i];
                        if (i < CL_MAX_USERCMDS - 1)
                                s.cmd.canjump = cl.movecmd[i+1].canjump;
-                               // FIXME doesn't this read from unused slots? shouldn't this rather be limited to the initial value of i?
 
                        // if a move is more than 50ms, do it as two moves (matching qwsv)
                        //Con_Printf("%i ", s.cmd.msec);
@@ -1624,6 +1623,12 @@ void CL_ClientMovement_Replay(void)
                                CL_ClientMovement_PlayerMove(&s);
                                cl.movecmd[i].canjump = s.cmd.canjump;
                        }
+                       else
+                       {
+                               // we REALLY need this handling to happen, even if the move is not executed
+                               if (!cl.movecmd[i].jump)
+                                       cl.movecmd[i].canjump = true;
+                       }
                }
                //Con_Printf("\n");
                CL_ClientMovement_UpdateStatus(&s);
@@ -1832,6 +1837,7 @@ void CL_SendMove(void)
                cl.cmd.forwardmove = cl.cmd.sidemove = cl.cmd.upmove = cl.cmd.impulse = cl.cmd.buttons = 0;
 
        cl.cmd.jump = (cl.cmd.buttons & 2) != 0;
+       cl.cmd.canjump = cl.movecmd[0].canjump;
        cl.cmd.crouch = 0;
        switch (cls.protocol)
        {