From 95ec2cf039f0efdc6dadfb6fe766ace231a1b6b1 Mon Sep 17 00:00:00 2001 From: Rangi Date: Thu, 25 Mar 2021 16:33:05 -0400 Subject: Verify data table and name list sizes with assertion macros Fixes #312 --- engine/pokemon/add_mon.asm | 2 +- engine/pokemon/evos_moves.asm | 4 ++-- engine/pokemon/learn_move.asm | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'engine/pokemon') diff --git a/engine/pokemon/add_mon.asm b/engine/pokemon/add_mon.asm index c49a0a77..46a8b2b9 100644 --- a/engine/pokemon/add_mon.asm +++ b/engine/pokemon/add_mon.asm @@ -259,7 +259,7 @@ AddPartyMon_WriteMovePP: push de push bc ld hl, Moves - ld bc, MoveEnd - Moves + ld bc, MOVE_LENGTH call AddNTimes ld de, wcd6d ld a, BANK(Moves) diff --git a/engine/pokemon/evos_moves.asm b/engine/pokemon/evos_moves.asm index 21b1c9f4..7d5fd469 100644 --- a/engine/pokemon/evos_moves.asm +++ b/engine/pokemon/evos_moves.asm @@ -161,7 +161,7 @@ Evolution_PartyMonLoop: ; loop over party mons ld a, [wd11e] dec a ld hl, BaseStats - ld bc, MonBaseStatsEnd - MonBaseStats + ld bc, BASE_DATA_SIZE call AddNTimes ld de, wMonHeader call CopyData @@ -479,7 +479,7 @@ WriteMonMoves: push hl dec a ld hl, Moves - ld bc, MoveEnd - Moves + ld bc, MOVE_LENGTH call AddNTimes ld de, wBuffer ld a, BANK(Moves) diff --git a/engine/pokemon/learn_move.asm b/engine/pokemon/learn_move.asm index 4deb3f0b..fd92ec57 100644 --- a/engine/pokemon/learn_move.asm +++ b/engine/pokemon/learn_move.asm @@ -44,7 +44,7 @@ DontAbandonLearning: push de dec a ld hl, Moves - ld bc, MoveEnd - Moves + ld bc, MOVE_LENGTH call AddNTimes ld de, wBuffer ld a, BANK(Moves) -- cgit v1.3.1-sl0p