From 0e455634975b12504e643d2620889935a03df83b Mon Sep 17 00:00:00 2001 From: i0brendan0 Date: Mon, 19 Feb 2018 02:54:13 -0600 Subject: Add Fix for Lock On Status Moves These changes should fix the status move and secondary effects not working if the opponent is flying or digging but has been locked on. --- docs/bugs_and_glitches.md | 7 ++++++- engine/battle/effect_commands.asm | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md index 5abf9d08a..7a4242ece 100644 --- a/docs/bugs_and_glitches.md +++ b/docs/bugs_and_glitches.md @@ -292,13 +292,18 @@ This is a bug with `CheckHiddenOpponent` in [engine/battle/effect_commands.asm]( ```asm CheckHiddenOpponent: ; 37daa ; BUG: This routine should account for Lock-On and Mind Reader. +; Uncomment the lines below to fix. + ; ld a, BATTLE_VARS_SUBSTATUS5_OPP + ; call GetBattleVar + ; bit SUBSTATUS_LOCK_ON, a + ; ret z ld a, BATTLE_VARS_SUBSTATUS3_OPP call GetBattleVar and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND ret ``` -*To do:* Fix this bug. +**Fix:** Uncomment those 4 lines to fix. ## Beat Up can desynchronize link battles diff --git a/engine/battle/effect_commands.asm b/engine/battle/effect_commands.asm index 48efba8fa..2cf4ac97d 100644 --- a/engine/battle/effect_commands.asm +++ b/engine/battle/effect_commands.asm @@ -9708,6 +9708,11 @@ BattleCommand_ThunderAccuracy: ; 37d94 CheckHiddenOpponent: ; 37daa ; BUG: This routine should account for Lock-On and Mind Reader. +; Uncomment the lines below to fix. + ; ld a, BATTLE_VARS_SUBSTATUS5_OPP + ; call GetBattleVar + ; bit SUBSTATUS_LOCK_ON, a + ; ret z ld a, BATTLE_VARS_SUBSTATUS3_OPP call GetBattleVar and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND -- cgit v1.2.3