Explain a major AI-related bug with type matchup checks
This commit is contained in:
@@ -1542,6 +1542,12 @@ BattleCheckTypeMatchup: ; 347c8
|
|||||||
jr z, CheckTypeMatchup
|
jr z, CheckTypeMatchup
|
||||||
ld hl, BattleMonType1
|
ld hl, BattleMonType1
|
||||||
CheckTypeMatchup: ; 347d3
|
CheckTypeMatchup: ; 347d3
|
||||||
|
; There is an incorrect assumption about this function made in the AI related code: when
|
||||||
|
; the AI calls CheckTypeMatchup (not BattleCheckTypeMatchup), it assumes that placing the
|
||||||
|
; offensive type in a will make this function do the right thing. Since a is overwritten,
|
||||||
|
; this assumption is incorrect. A simple fix would be to load the move type for the
|
||||||
|
; current move into a in BattleCheckTypeMatchup, before falling through, which is
|
||||||
|
; consistent with how the rest of the code assumes this code works like.
|
||||||
push hl
|
push hl
|
||||||
push de
|
push de
|
||||||
push bc
|
push bc
|
||||||
|
Reference in New Issue
Block a user