Skip to content

Commit

Permalink
fixes issues with surf and cycling road
Browse files Browse the repository at this point in the history
  • Loading branch information
meltheadorable committed Nov 5, 2018
1 parent f221d15 commit 5a0f269
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
18 changes: 17 additions & 1 deletion engine/items/items.asm
Original file line number Diff line number Diff line change
Expand Up @@ -685,8 +685,17 @@ ItemUseBicycle:
jp z,ItemUseNotTime
dec a ; is player already bicycling?
jr nz,.tryToGetOnBike
.getOffBike
.tryToGetOffBike
call ItemUseReloadOverworldData
ld a,[wPseudoItemID]
and a ; if not using select shortcut
jr z,.getOffBike
; check cycling road
ld a,[wd732]
bit 5,a
jr z,.getOffBike ; if not on cycling road, get off bike
jr .printCannotGetOffText
.getOffBike
xor a
ld [wWalkBikeSurfState],a ; change player state to walking
call PlayDefaultMusic ; play walking music
Expand All @@ -710,6 +719,13 @@ ItemUseBicycle:
ld hl,GotOnBicycleText
.printText
jp PrintText
.printCannotGetOffText
ld hl,CannotGetOffBicycleText
jp PrintText

CannotGetOffBicycleText:
TX_FAR _CannotGetOffHereText
db "@"

; used for Surf out-of-battle effect
ItemUseSurfboard:
Expand Down
12 changes: 11 additions & 1 deletion engine/overworld/bike_shortcut.asm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,17 @@ TryRideBike::
jr .cleanUp
.hasBike
farcall IsBikeRidingAllowed
jr c,.useItem
jr c,.checkSurfing
call EnableBikeShortcutText
.checkSurfing
ld a,[wWalkBikeSurfState]
cp a,2
jr nz,.checkCyclingRoad ; if not surfing
call EnableBikeShortcutText
.checkCyclingRoad
ld a,[wd732] ; cycling road
bit 5,a
jr z,.useItem ;if not on cycling road skip text
call EnableBikeShortcutText
.useItem
call UseItem
Expand Down

0 comments on commit 5a0f269

Please sign in to comment.