mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-02-20 19:02:34 +00:00
Don't jump repeatedly when holding jump
This commit is contained in:
parent
39deb64e4f
commit
71a25eef92
2 changed files with 5 additions and 4 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue