From 6adbaefde14f5e9039aa42a6c96ce476a4107925 Mon Sep 17 00:00:00 2001 From: Rangi Date: Sat, 28 Nov 2020 17:11:12 -0500 Subject: Keep wGrassMons and wWaterMons together with a UNION --- engine/battle/core.asm | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'engine') diff --git a/engine/battle/core.asm b/engine/battle/core.asm index d944424e..5ea60cb4 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -2013,18 +2013,19 @@ DisplayBattleMenu:: .menuselected ld [wTextBoxID], a call DisplayTextBoxID + ; handle menu input if it's not the old man tutorial ld a, [wBattleType] dec a - jp nz, .handleBattleMenuInput ; handle menu input if it's not the old man tutorial + jp nz, .handleBattleMenuInput ; the following happens for the old man tutorial - ; Temporarily save the player name in wGrassRate, - ; which is supposed to get overwritten when entering a - ; map with wild Pokémon. - ; Due to an oversight, the data may not get - ; overwritten (on Cinnabar and Route 21) and the infamous - ; Missingno. glitch can show up. + ; Temporarily save the player name in wLinkEnemyTrainerName. + ; Since wLinkEnemyTrainerName == wGrassRate, this affects wild encounters. + ; The wGrassRate byte and following wGrassMons buffer are supposed + ; to get overwritten when entering a map with wild Pokémon, + ; but an oversight prevents this in Cinnabar and Route 21, + ; so the infamous MissingNo. glitch can show up. ld hl, wPlayerName - ld de, wGrassRate + ld de, wLinkEnemyTrainerName ld bc, NAME_LENGTH call CopyData ld hl, .oldManName -- cgit v1.2.3