mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-20 13:23:45 -07:00
item: make SLOT macro safe for custom items
When creating custom items, have a fallback slot for custom item ids that don't have an entry in the itemId -> slot mapping table Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
parent
82fff58062
commit
dd53ad8cd4
1 changed files with 1 additions and 1 deletions
|
@ -65,7 +65,7 @@
|
|||
#define IS_DAY (gSaveContext.nightFlag == 0)
|
||||
#define IS_NIGHT (gSaveContext.nightFlag == 1)
|
||||
|
||||
#define SLOT(item) gItemSlots[item]
|
||||
#define SLOT(item) (item > ARRAY_COUNT(gItemSlots)-1 ? SLOT_BOTTLE_1 : gItemSlots[item])
|
||||
#define INV_CONTENT(item) gSaveContext.inventory.items[SLOT(item)]
|
||||
#define AMMO(item) gSaveContext.inventory.ammo[SLOT(item)]
|
||||
#define BEANS_BOUGHT AMMO(ITEM_BEAN + 1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue