ref: 0e455634975b12504e643d2620889935a03df83b
parent: 4046b41c3aaaf0d930f0268e52112aa7ea01e0a4
author: i0brendan0 <i0brendan0@github.com>
date: Sun Feb 18 21:54:13 EST 2018
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.
--- a/docs/bugs_and_glitches.md
+++ b/docs/bugs_and_glitches.md
@@ -292,6 +292,11 @@
```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
@@ -298,7 +303,7 @@
ret
```
-*To do:* Fix this bug.
+**Fix:** Uncomment those 4 lines to fix.
## Beat Up can desynchronize link battles
--- a/engine/battle/effect_commands.asm
+++ b/engine/battle/effect_commands.asm
@@ -9708,6 +9708,11 @@
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