Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix collision comparison in PlayerNotOnBikeMoving #2104

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions src/field_player_avatar.c
Original file line number Diff line number Diff line change
Expand Up @@ -620,9 +620,27 @@ static void PlayerNotOnBikeMoving(u8 direction, u16 heldKeys)
}
else
{
u8 adjustedCollision = collision - COLLISION_STOP_SURFING;
if (adjustedCollision > 3)
// Player collided with something. Certain collisions have special handling that precludes the normal collision effect.
// COLLISION_STOP_SURFING and COLLISION_PUSHED_BOULDER's effects are started by CheckForObjectEventCollision.
// COLLISION_LEDGE_JUMP's effect is handled further up in this function, so it will never reach this point.
// COLLISION_ROTATING_GATE is unusual however, this was probably included by mistake. When the player walks into a
// rotating gate that cannot rotate there is no additional handling, it's just a regular collision. Its exclusion here
// means that the player avatar won't update if they encounter this kind of collision. This has two noticeable effects:
// - Colliding with it head-on stops the player dead, rather than playing the walking animation and playing a bump sound effect
// - Colliding with it by changing direction won't turn the player avatar, their walking animation will just speed up.
#ifdef BUGFIX
if (collision != COLLISION_STOP_SURFING
&& collision != COLLISION_LEDGE_JUMP
&& collision != COLLISION_PUSHED_BOULDER)
#else
if (collision != COLLISION_STOP_SURFING
&& collision != COLLISION_LEDGE_JUMP
&& collision != COLLISION_PUSHED_BOULDER
&& collision != COLLISION_ROTATING_GATE)
#endif
{
PlayerNotOnBikeCollide(direction);
}
return;
}
}
Expand Down