summaryrefslogtreecommitdiff
path: root/engine/battle/core.asm
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2021-03-25 16:33:05 -0400
committerRangi <remy.oukaour+rangi42@gmail.com>2021-03-25 16:44:41 -0400
commit95ec2cf039f0efdc6dadfb6fe766ace231a1b6b1 (patch)
tree5a7b79846bd7f07e40310da46b21873774a08ef7 /engine/battle/core.asm
parente1f6bb53939be34f55e05cbbd19cd758936b3422 (diff)
Verify data table and name list sizes with assertion macros
Fixes #312
Diffstat (limited to 'engine/battle/core.asm')
-rw-r--r--engine/battle/core.asm10
1 files changed, 5 insertions, 5 deletions
diff --git a/engine/battle/core.asm b/engine/battle/core.asm
index 433c62df..d9bcdddb 100644
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -1633,7 +1633,7 @@ LoadBattleMonFromParty:
ld bc, wPartyMon1DVs - wPartyMon1OTID
add hl, bc
ld de, wBattleMonDVs
- ld bc, NUM_DVS
+ ld bc, wPartyMon1PP - wPartyMon1DVs
call CopyData
ld de, wBattleMonPP
ld bc, NUM_MOVES
@@ -1677,7 +1677,7 @@ LoadEnemyMonFromParty:
ld bc, wEnemyMon1DVs - wEnemyMon1OTID
add hl, bc
ld de, wEnemyMonDVs
- ld bc, NUM_DVS
+ ld bc, wEnemyMon1PP - wEnemyMon1DVs
call CopyData
ld de, wEnemyMonPP
ld bc, NUM_MOVES
@@ -5101,7 +5101,7 @@ ReloadMoveData:
ld [wd11e], a
dec a
ld hl, Moves
- ld bc, MoveEnd - Moves
+ ld bc, MOVE_LENGTH
call AddNTimes
ld a, BANK(Moves)
call FarCopyData ; copy the move's stats
@@ -5133,7 +5133,7 @@ MetronomePickMove:
call BattleRandom
and a
jr z, .pickMoveLoop
- cp NUM_ATTACKS + 1 ; max normal move number + 1 (this is Struggle's move number)
+ cp NUM_ATTACKS ; max move number (including Struggle)
jr nc, .pickMoveLoop
cp METRONOME
jr z, .pickMoveLoop
@@ -6077,7 +6077,7 @@ GetCurrentMove:
ld [wd0b5], a
dec a
ld hl, Moves
- ld bc, MoveEnd - Moves
+ ld bc, MOVE_LENGTH
call AddNTimes
ld a, BANK(Moves)
call FarCopyData