diff --git a/constants/mart_constants.asm b/constants/mart_constants.asm index 1a2d08fef..32b193cfa 100644 --- a/constants/mart_constants.asm +++ b/constants/mart_constants.asm @@ -5,6 +5,7 @@ const MARTTYPE_BARGAIN const MARTTYPE_PHARMACY const MARTTYPE_ROOFTOP +DEF NUM_MART_TYPES EQU const_value ; Marts indexes (see data/items/marts.asm) const_def diff --git a/engine/items/mart.asm b/engine/items/mart.asm index 8149fd709..e1c5010cb 100644 --- a/engine/items/mart.asm +++ b/engine/items/mart.asm @@ -12,16 +12,19 @@ OpenMartDialog:: ld [wMartType], a call LoadMartPointer ld a, [wMartType] - ld hl, .dialogs + ld hl, MartTypeDialogs rst JumpTable ret -.dialogs +MartTypeDialogs: +; entries correspond to MARTTYPE_* constants + table_width 2 dw MartDialog dw HerbShop dw BargainShop dw Pharmacist dw RooftopSale + assert_table_length NUM_MART_TYPES MartDialog: ld a, MARTTYPE_STANDARD