diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md index 688a4d455..596463a09 100644 --- a/docs/bugs_and_glitches.md +++ b/docs/bugs_and_glitches.md @@ -35,6 +35,7 @@ - [Playing Entei's Pokédex cry can distort Raikou's and Suicune's](#playing-enteis-pokédex-cry-can-distort-raikous-and-suicunes) - [`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) +- [`Function6ec1` does not correctly limit object movement](#function6ec1-does-not-correctly-limit-object-movement) - [`CheckOwnMon` only checks the first five letters of OT names](#checkownmon-only-checks-the-first-five-letters-of-ot-names) - [Catching a Transformed Pokémon always catches a Ditto](#catching-a-transformed-pokémon-always-catches-a-ditto) - [Using a Park Ball in normal battles has a corrupt animation](#using-a-park-ball-in-normal-battles-has-a-corrupt-animation) @@ -974,6 +975,22 @@ In [home/map.asm](/home/map.asm): *To do:* Identify specific code causing this bug and fix it. +## `Function6ec1` does not correctly limit object movement + +This bug is why the Lapras in Union Cave, which uses `SPRITEMOVEDATA_LAPRAS`, is not restricted by its `1, 1` movement radius. + +In [engine/npc_movement.asm](/engine/npc_movement.asm): + +```asm + ld hl, OBJECT_FLAGS1 + add hl, bc + bit 4, [hl] ; lost, uncomment next line to fix +; jr nz, .resume +``` + +**Fix:** Uncomment `jr nz, .resume`. + + ## `CheckOwnMon` only checks the first five letters of OT names ([Video](https://www.youtube.com/watch?v=GVTTmReM4nQ)) diff --git a/engine/npc_movement.asm b/engine/npc_movement.asm index 9a18cdcb1..e102cc554 100755 --- a/engine/npc_movement.asm +++ b/engine/npc_movement.asm @@ -7,7 +7,8 @@ Function6ec1: ; 6ec1 ld hl, OBJECT_FLAGS1 add hl, bc - bit 4, [hl] ; lost + bit 4, [hl] ; lost, uncomment next line to fix +; jr nz, .resume push hl push bc call Function6f2c