shithub: pokecrystal

Download patch

ref: 1674b6ca5a8b7ae9a2d4e34a8c846f2ee88cb85d
parent: 06dd208cc72b49da3d57233ecf948618b7520d9a
author: Damien Doury <[email protected]>
date: Thu Apr 6 14:05:59 EDT 2023

Fixed the wrong CheckHiddenOpponent bugfix (#1046)


--- a/docs/bugs_and_glitches.md
+++ b/docs/bugs_and_glitches.md
@@ -614,10 +614,15 @@
 ```diff
  CheckHiddenOpponent:
 -; BUG: Lock-On and Mind Reader don't always bypass Fly and Dig (see docs/bugs_and_glitches.md)
--	ld a, BATTLE_VARS_SUBSTATUS3_OPP
--	call GetBattleVar
--	and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND
-+	xor a
++	ld a, BATTLE_VARS_SUBSTATUS5_OPP
++	call GetBattleVar
++	cpl
++	and 1 << SUBSTATUS_LOCK_ON
++	ret z
++
+ 	ld a, BATTLE_VARS_SUBSTATUS3_OPP
+ 	call GetBattleVar
+ 	and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND
  	ret
 ```