diff options
Diffstat (limited to 'src/bike.c')
-rw-r--r-- | src/bike.c | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/src/bike.c b/src/bike.c index c4964b627..62ce3cd44 100644 --- a/src/bike.c +++ b/src/bike.c @@ -614,27 +614,24 @@ static void AcroBikeTransition_WheelieHoppingMoving(u8 direction) return; } collision = GetBikeCollision(direction); - // TODO: Try to get rid of this goto - if (collision == 0 || collision == COLLISION_WHEELIE_HOP) + if (collision && collision != COLLISION_WHEELIE_HOP) { - goto derp; - } - else if (collision == COLLISION_LEDGE_JUMP) - { - PlayerLedgeHoppingWheelie(direction); - } - else if (collision < COLLISION_STOP_SURFING || collision > COLLISION_ROTATING_GATE) - { - if (collision < COLLISION_VERTICAL_RAIL) + if (collision == COLLISION_LEDGE_JUMP) { - AcroBikeTransition_WheelieHoppingStanding(direction); + PlayerLedgeHoppingWheelie(direction); + return; } - else + if (collision >= COLLISION_STOP_SURFING && collision <= COLLISION_ROTATING_GATE) + { + return; + } + if (collision < COLLISION_VERTICAL_RAIL) { - derp: - PlayerMovingHoppingWheelie(direction); + AcroBikeTransition_WheelieHoppingStanding(direction); + return; } } + PlayerMovingHoppingWheelie(direction); } static void AcroBikeTransition_SideJump(u8 direction) @@ -963,9 +960,10 @@ bool8 IsBikingDisallowedByPlayer(void) return TRUE; } -bool8 player_should_look_direction_be_enforced_upon_movement(void) +bool8 IsPlayerNotUsingAcroBikeOnBumpySlope(void) { - if (TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_ACRO_BIKE) != FALSE && MetatileBehavior_IsBumpySlope(gObjectEvents[gPlayerAvatar.objectEventId].currentMetatileBehavior) != FALSE) + if (TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_ACRO_BIKE) + && MetatileBehavior_IsBumpySlope(gObjectEvents[gPlayerAvatar.objectEventId].currentMetatileBehavior)) return FALSE; else return TRUE; |