summaryrefslogtreecommitdiff
path: root/battle/effect_commands.asm
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2017-06-24 17:43:48 -0400
committerGitHub <noreply@github.com>2017-06-24 17:43:48 -0400
commitd0d61cb3ab847ff0c72a840363b89d4acf05b5f5 (patch)
tree8c5fd287e727f253f84c89ce32f01a76f948e4fb /battle/effect_commands.asm
parent080704e49f49777baac124d1bba8c1066acd1bb1 (diff)
parent0e76127da878efbe86997eb5a58e6bcd4bf66ff5 (diff)
Merge pull request #354 from FredrIQ/comments
Fix a reversed label mistake and reference a major bug
Diffstat (limited to 'battle/effect_commands.asm')
-rw-r--r--battle/effect_commands.asm8
1 files changed, 7 insertions, 1 deletions
diff --git a/battle/effect_commands.asm b/battle/effect_commands.asm
index 54af56a10..221570d76 100644
--- a/battle/effect_commands.asm
+++ b/battle/effect_commands.asm
@@ -971,7 +971,7 @@ BattleCommand_CheckObedience: ; 343db
.EndDisobedience:
xor a
ld [LastPlayerMove], a
- ld [LastEnemyCounterMove], a
+ ld [LastPlayerCounterMove], a
; Break Encore too.
ld hl, PlayerSubStatus5
@@ -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