diff options
author | Rangi <remy.oukaour+rangi42@gmail.com> | 2021-03-11 16:28:52 -0500 |
---|---|---|
committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2021-03-11 16:31:40 -0500 |
commit | dc17d58170e80c4679c391017492da613fea3236 (patch) | |
tree | f082094bb56a6cff255a34c5b1e43aaa3ee7c477 /engine | |
parent | 0d185fbd88a5fa3d205553555d75c1c0ee397ec6 (diff) |
Verify script command table sizes
Diffstat (limited to 'engine')
-rw-r--r-- | engine/battle_anims/anim_commands.asm | 2 | ||||
-rw-r--r-- | engine/overworld/movement.asm | 2 | ||||
-rw-r--r-- | engine/overworld/scripting.asm | 2 |
3 files changed, 6 insertions, 0 deletions
diff --git a/engine/battle_anims/anim_commands.asm b/engine/battle_anims/anim_commands.asm index 9d9e6ef5..52245d6a 100644 --- a/engine/battle_anims/anim_commands.asm +++ b/engine/battle_anims/anim_commands.asm @@ -302,6 +302,7 @@ RunBattleAnimCommand: BattleAnimCommands:: ; entries correspond to anim_* constants (see macros/scripts/battle_anims.asm) + table_width 2, BattleAnimCommands dw BattleAnimCmd_Obj dw BattleAnimCmd_1GFX dw BattleAnimCmd_2GFX @@ -350,6 +351,7 @@ BattleAnimCommands:: dw BattleAnimCmd_Loop dw BattleAnimCmd_Call dw BattleAnimCmd_Ret + assert_table_length $100 - FIRST_BATTLE_ANIM_CMD BattleAnimCmd_E8: BattleAnimCmd_E9: diff --git a/engine/overworld/movement.asm b/engine/overworld/movement.asm index 4c90c92d..795f0cdc 100644 --- a/engine/overworld/movement.asm +++ b/engine/overworld/movement.asm @@ -1,5 +1,6 @@ MovementPointers: ; entries correspond to movement_* constants (see macros/scripts/movement.asm) + table_width 2, MovementPointers dw Movement_turn_head_down ; 00 dw Movement_turn_head_up ; 01 dw Movement_turn_head_left ; 02 @@ -89,6 +90,7 @@ MovementPointers: dw Movement_tree_shake ; 56 dw Movement_rock_smash ; 57 dw Movement_return_dig ; 58 + assert_table_length NUM_MOVEMENT_CMDS Movement_teleport_from: ld hl, OBJECT_STEP_TYPE diff --git a/engine/overworld/scripting.asm b/engine/overworld/scripting.asm index c2909437..631ee418 100644 --- a/engine/overworld/scripting.asm +++ b/engine/overworld/scripting.asm @@ -63,6 +63,7 @@ RunScriptCommand: ScriptCommandTable: ; entries correspond to *_command constants (see macros/scripts/events.asm) + table_width 2, ScriptCommandTable dw Script_scall ; 00 dw Script_farscall ; 01 dw Script_memcall ; 02 @@ -225,6 +226,7 @@ ScriptCommandTable: dw Script_halloffame ; 9f dw Script_credits ; a0 dw Script_warpfacing ; a1 + assert_table_length NUM_EVENT_COMMANDS StartScript: ld hl, wScriptFlags |