summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRemy Oukaour <remy.oukaour@gmail.com>2017-12-21 11:43:41 -0500
committerRemy Oukaour <remy.oukaour@gmail.com>2017-12-21 11:43:41 -0500
commit02609940dbf50e1a4d7052646bedd67a2796136b (patch)
treedf6e9f4db940c48b0e61912d811a480bdd3af3cc
parent2fa1e97aebdb23445355a74ca7f49787508f4f0d (diff)
Document one more bug
-rw-r--r--docs/bugs_and_glitches.md17
-rwxr-xr-xengine/npc_movement.asm3
2 files changed, 19 insertions, 1 deletions
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