Verify the mart types pointer table length
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
const MARTTYPE_BARGAIN
|
const MARTTYPE_BARGAIN
|
||||||
const MARTTYPE_PHARMACY
|
const MARTTYPE_PHARMACY
|
||||||
const MARTTYPE_ROOFTOP
|
const MARTTYPE_ROOFTOP
|
||||||
|
DEF NUM_MART_TYPES EQU const_value
|
||||||
|
|
||||||
; Marts indexes (see data/items/marts.asm)
|
; Marts indexes (see data/items/marts.asm)
|
||||||
const_def
|
const_def
|
||||||
|
@@ -12,16 +12,19 @@ OpenMartDialog::
|
|||||||
ld [wMartType], a
|
ld [wMartType], a
|
||||||
call LoadMartPointer
|
call LoadMartPointer
|
||||||
ld a, [wMartType]
|
ld a, [wMartType]
|
||||||
ld hl, .dialogs
|
ld hl, MartTypeDialogs
|
||||||
rst JumpTable
|
rst JumpTable
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.dialogs
|
MartTypeDialogs:
|
||||||
|
; entries correspond to MARTTYPE_* constants
|
||||||
|
table_width 2
|
||||||
dw MartDialog
|
dw MartDialog
|
||||||
dw HerbShop
|
dw HerbShop
|
||||||
dw BargainShop
|
dw BargainShop
|
||||||
dw Pharmacist
|
dw Pharmacist
|
||||||
dw RooftopSale
|
dw RooftopSale
|
||||||
|
assert_table_length NUM_MART_TYPES
|
||||||
|
|
||||||
MartDialog:
|
MartDialog:
|
||||||
ld a, MARTTYPE_STANDARD
|
ld a, MARTTYPE_STANDARD
|
||||||
|
Reference in New Issue
Block a user