From bc682624496b854607b8e1bd976bb317eb8b0d4f Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 14 Dec 2018 01:20:44 +0300 Subject: Add inventory size field into db and using it in server. --- src/map/rodex.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/map/rodex.c') diff --git a/src/map/rodex.c b/src/map/rodex.c index 602754d42..eea27b6d0 100644 --- a/src/map/rodex.c +++ b/src/map/rodex.c @@ -83,7 +83,7 @@ static void rodex_add_item(struct map_session_data *sd, int16 idx, int16 amount) nullpo_retv(sd); - if (idx < 0 || idx >= MAX_INVENTORY) { + if (idx < 0 || idx >= sd->status.inventorySize) { clif->rodex_add_item_result(sd, idx, amount, RODEX_ADD_ITEM_FATAL_ERROR); return; } @@ -160,7 +160,7 @@ static void rodex_remove_item(struct map_session_data *sd, int16 idx, int16 amou struct item_data *itd; nullpo_retv(sd); - Assert_retv(idx >= 0 && idx < MAX_INVENTORY); + Assert_retv(idx >= 0 && idx < sd->status.inventorySize); for (i = 0; i < RODEX_MAX_ITEM; ++i) { if (sd->rodex.tmp.items[i].idx == idx) @@ -504,7 +504,7 @@ static void rodex_get_items(struct map_session_data *sd, int8 opentype, int64 ma } required_slots = msg->items_count; - for (i = 0; i < MAX_INVENTORY; ++i) { + for (i = 0; i < sd->status.inventorySize; ++i) { if (sd->status.inventory[i].nameid == 0) { empty_slots++; } else if (itemdb->isstackable(sd->status.inventory[i].nameid) == 1) { -- cgit v1.2.3-60-g2f50