summaryrefslogtreecommitdiff
path: root/battle/effect_commands.asm
diff options
context:
space:
mode:
authorFredrik Ljungdahl <fredde1994@gmail.com>2017-01-08 01:33:38 +0100
committerFredrik Ljungdahl <fredde1994@gmail.com>2017-01-08 01:33:38 +0100
commit9b8f57a7308691f67f9025b5dcc621941dbc3afd (patch)
treee253cbddd70fa5e836ee16852ed3b0c4c6feff0a /battle/effect_commands.asm
parentf8455e9b4f0270811dac718810811292beb41da6 (diff)
Explain a major AI-related bug with type matchup checks
Diffstat (limited to 'battle/effect_commands.asm')
-rw-r--r--battle/effect_commands.asm6
1 files changed, 6 insertions, 0 deletions
diff --git a/battle/effect_commands.asm b/battle/effect_commands.asm
index 8e0c694b3..e730c457a 100644
--- a/battle/effect_commands.asm
+++ b/battle/effect_commands.asm
@@ -1542,6 +1542,12 @@ BattleCheckTypeMatchup: ; 347c8
jr z, CheckTypeMatchup
ld hl, BattleMonType1
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 de
push bc