Merge pull request #2104 from GriffinRichards/fix-collision-comparison
Fix collision comparison in PlayerNotOnBikeMoving
This commit is contained in:
@@ -619,9 +619,27 @@ static void PlayerNotOnBikeMoving(u8 direction, u16 heldKeys)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
u8 adjustedCollision = collision - COLLISION_STOP_SURFING;
|
// Player collided with something. Certain collisions have special handling that precludes the normal collision effect.
|
||||||
if (adjustedCollision > 3)
|
// 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);
|
PlayerNotOnBikeCollide(direction);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user