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.
This commit is contained in:
ac-stef
2015-09-26 11:34:47 +02:00
parent 5006663d19
commit d75409a29c
+2 -2
View File
@@ -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;
}