From d75409a29cc98ac1f0037214b9605fff72e388cd Mon Sep 17 00:00:00 2001 From: ac-stef Date: Sat, 26 Sep 2015 11:34:47 +0200 Subject: [PATCH] fix ladder physics When both "forward" and "backward" keys are pressed, now the action matches the last pressed one. Now the keys work on the ladder exactly as with regular movement. --- source/src/physics.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/src/physics.cpp b/source/src/physics.cpp index 32c6f1c7..f340470f 100644 --- a/source/src/physics.cpp +++ b/source/src/physics.cpp @@ -504,8 +504,8 @@ void moveplayer(physent *pl, int moveres, bool local, int curtime) if(pl->type==ENT_BOT && pl->state == CS_ALIVE) pl->vel.z = climbspeed; // bots climb upwards only else if(pl->type==ENT_PLAYER && pl->state == CS_ALIVE) { - if(((playerent *)pl)->k_up) pl->vel.z = climbspeed; - else if(((playerent *)pl)->k_down) pl->vel.z = -climbspeed; + if(((playerent *)pl)->k_up && pl->move > 0) pl->vel.z = climbspeed; + else if(((playerent *)pl)->k_down && pl->move < 0) pl->vel.z = -climbspeed; } pl->timeinair = 0; }