Verify data table sizes with table_width and assert_table_length macros
This was discussed in #706 It also uncovered some off-by-one issues with defining some constants. A few structs now use rsreset/_RS to define their offset constants, as discussed in #739
This commit is contained in:
@@ -20,6 +20,7 @@ MonMenuOptionStrings:
|
||||
|
||||
MonMenuOptions:
|
||||
; category, item, value; actions are in PokemonActionSubmenu (see engine/pokemon/mon_menu.asm)
|
||||
table_width 3, MonMenuOptions
|
||||
; moves
|
||||
db MONMENU_FIELD_MOVE, MONMENUITEM_CUT, CUT
|
||||
db MONMENU_FIELD_MOVE, MONMENUITEM_FLY, FLY
|
||||
@@ -43,4 +44,5 @@ MonMenuOptions:
|
||||
db MONMENU_MENUOPTION, MONMENUITEM_MOVE, MONMENUVALUE_MOVE
|
||||
db MONMENU_MENUOPTION, MONMENUITEM_MAIL, MONMENUVALUE_MAIL
|
||||
db MONMENU_MENUOPTION, MONMENUITEM_ERROR, MONMENUVALUE_ERROR
|
||||
db -1
|
||||
assert_table_length NUM_MONMENUITEMS
|
||||
db -1 ; end
|
||||
|
Reference in New Issue
Block a user