shithub: pokecrystal

Download patch

ref: 9801b93906befbd84cbf7dd333d59a95dd60ce0e
parent: b764a3a84d836768c385e9131ab458e0edfe0716
author: vulcandth <[email protected]>
date: Tue Aug 30 20:43:12 EDT 2022

Add Bug comment for fishing/surfing on NPCs

Also this re-orders `FishFunction:` and `SurfFunction:` in the bug doc, since `SurfFunction:` is encountered in the file first.

--- a/docs/bugs_and_glitches.md
+++ b/docs/bugs_and_glitches.md
@@ -1663,28 +1663,11 @@
 **Fix**: Edit [engine/events/overworld.asm](https://github.com/pret/pokecrystal/blob/master/engine/events/overworld.asm):
 
 ```diff
- FishFunction:
- ...
-
- .TryFish:
- 	ld a, [wPlayerState]
- 	cp PLAYER_SURF
- 	jr z, .fail
- 	cp PLAYER_SURF_PIKA
- 	jr z, .fail
-+	call GetFacingObject
-+	jr nc, .fail
- 	call GetFacingTileCoord
- 	call GetTileCollision
- 	cp WATER_TILE
- 	jr z, .facingwater
-```
-
-```diff
  SurfFunction:
  ...
 
  .TrySurf:
+-; BUG: You can Surf and fish on top of NPCs (see docs/bugs_and_glitches.md)
  	ld de, ENGINE_FOGBADGE
  	call CheckBadge
  	jr c, .nofogbadge
@@ -1708,6 +1691,24 @@
 -	jr c, .cannotsurf
  	ld a, $1
  	ret
+```
+
+```diff
+ FishFunction:
+ ...
+
+ .TryFish:
+ 	ld a, [wPlayerState]
+ 	cp PLAYER_SURF
+ 	jr z, .fail
+ 	cp PLAYER_SURF_PIKA
+ 	jr z, .fail
++	call GetFacingObject
++	jr nc, .fail
+ 	call GetFacingTileCoord
+ 	call GetTileCollision
+ 	cp WATER_TILE
+ 	jr z, .facingwater
 ```
 
 
--- a/engine/events/overworld.asm
+++ b/engine/events/overworld.asm
@@ -344,6 +344,7 @@
 	dw .AlreadySurfing
 
 .TrySurf:
+; BUG: You can Surf and fish on top of NPCs (see docs/bugs_and_glitches.md)
 	ld de, ENGINE_FOGBADGE
 	call CheckBadge
 	jr c, .nofogbadge