Fix collision comparison in PlayerNotOnBikeMoving

This commit is contained in:
GriffinR
2025-02-13 15:13:04 -05:00
parent f827022704
commit b464fdbbde

View File

@@ -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;
}
}