summaryrefslogtreecommitdiff
path: root/data/items/attributes.asm
diff options
context:
space:
mode:
authorRangi <35663410+Rangi42@users.noreply.github.com>2021-03-08 07:01:31 -0800
committerGitHub <noreply@github.com>2021-03-08 07:01:31 -0800
commite791c5392b19f589c51afd98666d19e778278847 (patch)
tree4392cbecdd5166484f3a8ec8799939434159bae3 /data/items/attributes.asm
parentfb35fe6aba5e4e4ce7edf5b345fdf2afec4b6b49 (diff)
parent98da09b3e90b6a132ce6d2431999485593aef0c9 (diff)
Merge pull request #806 from Rangi42/tables
Verify data table sizes with table_width and assert_table_length macros
Diffstat (limited to 'data/items/attributes.asm')
-rw-r--r--data/items/attributes.asm7
1 files changed, 6 insertions, 1 deletions
diff --git a/data/items/attributes.asm b/data/items/attributes.asm
index 60ada8b6e..459212835 100644
--- a/data/items/attributes.asm
+++ b/data/items/attributes.asm
@@ -6,7 +6,8 @@ item_attribute: MACRO
ENDM
ItemAttributes:
-; entries correspond to item ids
+; entries correspond to item ids (see constants/item_constants.asm)
+ table_width ITEMATTR_STRUCT_LENGTH, ItemAttributes
; MASTER_BALL
item_attribute 0, HELD_NONE, 0, CANT_SELECT, BALL, ITEMMENU_NOUSE, ITEMMENU_CLOSE
; ULTRA_BALL
@@ -387,6 +388,7 @@ ItemAttributes:
item_attribute 50, HELD_NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE
; ITEM_BE
item_attribute $9999, HELD_NONE, 0, NO_LIMITS, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE
+ assert_table_length NUM_ITEMS
; TM01
item_attribute 3000, HELD_NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE
; TM02
@@ -491,6 +493,7 @@ ItemAttributes:
item_attribute 3000, HELD_NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE
; TM50
item_attribute 2000, HELD_NONE, 0, CANT_SELECT, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE
+ assert_table_length NUM_ITEMS + NUM_TMS + 2 ; count ITEM_C3 and ITEM_DC
; HM01
item_attribute 0, HELD_NONE, 0, CANT_SELECT | CANT_TOSS, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE
; HM02
@@ -505,6 +508,7 @@ ItemAttributes:
item_attribute 0, HELD_NONE, 0, CANT_SELECT | CANT_TOSS, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE
; HM07
item_attribute 0, HELD_NONE, 0, CANT_SELECT | CANT_TOSS, TM_HM, ITEMMENU_PARTY, ITEMMENU_NOUSE
+ assert_table_length NUM_ITEMS + NUM_TMS + 2 + NUM_HMS ; count ITEM_C3 and ITEM_DC
; ITEM_FA
item_attribute $9999, HELD_NONE, 0, NO_LIMITS, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE
; $fb
@@ -519,3 +523,4 @@ ItemAttributes:
item_attribute $9999, HELD_NONE, 0, NO_LIMITS, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE
; $00
item_attribute $9999, HELD_NONE, 0, NO_LIMITS, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE
+ assert_table_length $100