Document bike.c and fix weird goto

This commit is contained in:
PikalaxALT
2021-03-30 15:45:42 -04:00
parent 35b68c68ee
commit 8e82c291fd
9 changed files with 135 additions and 131 deletions
+2 -2
View File
@@ -263,7 +263,7 @@ void FieldUseFunc_MachBike(u8 taskId)
|| MetatileBehavior_IsIsolatedVerticalRail(behavior) == TRUE
|| MetatileBehavior_IsIsolatedHorizontalRail(behavior) == TRUE)
DisplayItemMessageInCurrentContext(taskId, gTasks[taskId].data[3], 2, gUnknown_8416451);
else if (Overworld_IsBikingAllowed() == TRUE && !MetatileAtPlayerPositionForbidsBiking())
else if (Overworld_IsBikingAllowed() == TRUE && !IsBikingDisallowedByPlayer())
{
sItemUseOnFieldCB = ItemUseOnFieldCB_Bicycle;
sub_80A103C(taskId);
@@ -276,7 +276,7 @@ static void ItemUseOnFieldCB_Bicycle(u8 taskId)
{
if (!TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_MACH_BIKE | PLAYER_AVATAR_FLAG_ACRO_BIKE))
PlaySE(SE_BIKE_BELL);
StartTransitionToFlipBikeState(PLAYER_AVATAR_FLAG_MACH_BIKE | PLAYER_AVATAR_FLAG_ACRO_BIKE);
GoOnOffBike(PLAYER_AVATAR_FLAG_MACH_BIKE | PLAYER_AVATAR_FLAG_ACRO_BIKE);
ClearPlayerHeldMovementAndUnfreezeObjectEvents();
ScriptContext2_Disable();
DestroyTask(taskId);