From b764a3a84d836768c385e9131ab458e0edfe0716 Mon Sep 17 00:00:00 2001 From: Rangi Date: Tue, 30 Aug 2022 17:06:12 -0400 Subject: [PATCH] Document fix for fishing and Surfing on top of NPCs Fixes #994 --- docs/bugs_and_glitches.md | 56 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md index 3f5aad0f9..e0e76147c 100644 --- a/docs/bugs_and_glitches.md +++ b/docs/bugs_and_glitches.md @@ -66,6 +66,7 @@ Fixes in the [multi-player battle engine](#multi-player-battle-engine) category - [`LoadMetatiles` wraps around past 128 blocks](#loadmetatiles-wraps-around-past-128-blocks) - [Surfing directly across a map connection does not load the new map](#surfing-directly-across-a-map-connection-does-not-load-the-new-map) - [Swimming NPCs aren't limited by their movement radius](#swimming-npcs-arent-limited-by-their-movement-radius) + - [You can Surf and fish on top of NPCs](#you-can-surf-and-fish-on-top-of-npcs) - [Pokémon deposited in the Day-Care might lose experience](#pok%C3%A9mon-deposited-in-the-day-care-might-lose-experience) - [Graphics](#graphics) - [In-battle “`…`” ellipsis is too high](#in-battle--ellipsis-is-too-high) @@ -1657,11 +1658,64 @@ This bug is why the Lapras in [maps/UnionCaveB2F.asm](https://github.com/pret/po ``` +### You can Surf and fish on top of NPCs + +**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: + ld de, ENGINE_FOGBADGE + call CheckBadge + jr c, .nofogbadge + ld hl, wBikeFlags + bit BIKEFLAGS_ALWAYS_ON_BIKE_F, [hl] + jr nz, .cannotsurf + ld a, [wPlayerState] + cp PLAYER_SURF + jr z, .alreadyfail + cp PLAYER_SURF_PIKA + jr z, .alreadyfail ++ call GetFacingObject ++ jr nc, .cannotsurf + call GetFacingTileCoord + call GetTileCollision + cp WATER_TILE + jr nz, .cannotsurf + call CheckDirection + jr c, .cannotsurf +- farcall CheckFacingObject +- jr c, .cannotsurf + ld a, $1 + ret +``` + + ### Pokémon deposited in the Day-Care might lose experience When a Pokémon is withdrawn from the Day-Care, its Exp. Points are reset to the minimum required for its level. This means that if it hasn't gained any levels, it may lose experience. -**Fix**: Edit `RetrieveBreedmon` in [engine/pokemon/move_mon.asm](https://github.com/pret/pokecrystal/blob/master/engine/pokemon/move_mon.asm): +**Fix:** Edit `RetrieveBreedmon` in [engine/pokemon/move_mon.asm](https://github.com/pret/pokecrystal/blob/master/engine/pokemon/move_mon.asm): ```diff RetrieveBreedmon: