summaryrefslogtreecommitdiff
path: root/data/trainers/attributes.asm
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2021-03-03 22:22:41 -0500
committerRangi <remy.oukaour+rangi42@gmail.com>2021-03-05 16:10:25 -0500
commit5454e1e0deefc6b4fc8c4de0e63314052fceebc0 (patch)
tree565805b252fa596aab3f80b3128ebc91b1fae540 /data/trainers/attributes.asm
parentb423e94be700cc6434465cf1dcccf0b677489192 (diff)
Verify data table sizes with table_width and assert_table_length macros
It also uncovered some off-by-one issues with defining some constants. A few structs now use rsreset/_RS to define their offset constants.
Diffstat (limited to 'data/trainers/attributes.asm')
-rw-r--r--data/trainers/attributes.asm3
1 files changed, 3 insertions, 0 deletions
diff --git a/data/trainers/attributes.asm b/data/trainers/attributes.asm
index 86f5841c..8170f28b 100644
--- a/data/trainers/attributes.asm
+++ b/data/trainers/attributes.asm
@@ -1,5 +1,6 @@
TrainerClassAttributes:
; entries correspond to trainer classes (see constants/trainer_constants.asm)
+ table_width NUM_TRAINER_ATTRIBUTES, TrainerClassAttributes
; Falkner
db NO_ITEM, NO_ITEM ; items
@@ -396,3 +397,5 @@ TrainerClassAttributes:
db 10 ; base reward
dw AI_BASIC | AI_TYPES | AI_OPPORTUNIST | AI_CAUTIOUS | AI_STATUS | AI_RISKY
dw CONTEXT_USE | SWITCH_SOMETIMES
+
+ assert_table_length NUM_TRAINER_CLASSES