Don't jump repeatedly when holding jump

This commit is contained in:
MascaraSnake 2019-06-15 21:58:58 +02:00
parent 39deb64e4f
commit 71a25eef92
2 changed files with 5 additions and 4 deletions

View file

@ -1718,6 +1718,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
mcart->friction = FRACUNIT;
P_ResetPlayer(player);
player->pflags |= PF_JUMPDOWN;
player->powers[pw_carry] = CR_MINECART;
toucher->player->pflags &= ~PF_APPLYAUTOBRAKE;
P_SetTarget(&toucher->tracer, mcart);

View file

@ -9990,9 +9990,7 @@ static void P_MinecartThink(player_t *player)
//P_ResetPlayer(player);
// Player holding jump?
if (player->cmd.buttons & BT_JUMP)
player->pflags |= PF_JUMPDOWN;
else
if (!(player->cmd.buttons & BT_JUMP))
player->pflags &= ~PF_JUMPDOWN;
// Handle segments.
@ -10103,8 +10101,10 @@ static void P_MinecartThink(player_t *player)
// currentSpeed -= FRACUNIT/8;
// Jumping
if (player->cmd.buttons & BT_JUMP)
if ((player->cmd.buttons & BT_JUMP) && !(player->pflags & PF_JUMPDOWN))
{
player->pflags |= PF_JUMPDOWN;
if (minecart->eflags & MFE_ONGROUND)
minecart->eflags &= ~MFE_ONGROUND;
minecart->z += P_MobjFlip(minecart);