summaryrefslogtreecommitdiff
path: root/battle/effect_commands.asm
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2017-06-24 20:42:25 -0400
committerGitHub <noreply@github.com>2017-06-24 20:42:25 -0400
commit5dfe27125b589a6a38c5d43fddd3724386e9803b (patch)
tree5d21f6dff1ddc8cf44deca26b52dd897719ceb22 /battle/effect_commands.asm
parentfc300ab0ee63a1ecbcead67c3a7019a0bfe8deb5 (diff)
parentdbaec2053429e04f21613c3c0964e213008bfdb9 (diff)
Merge branch 'master' into tools-makefile-integration
Diffstat (limited to 'battle/effect_commands.asm')
-rw-r--r--battle/effect_commands.asm10
1 files changed, 8 insertions, 2 deletions
diff --git a/battle/effect_commands.asm b/battle/effect_commands.asm
index a74dea632..221570d76 100644
--- a/battle/effect_commands.asm
+++ b/battle/effect_commands.asm
@@ -113,7 +113,7 @@ DoMove: ; 3402c
jr .ReadMoveEffectCommand
.DoMoveEffectCommand:
- jp [hl]
+ jp hl
; 34084
@@ -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