diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-12-14 01:20:44 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-12-14 23:52:47 +0300 |
commit | bc682624496b854607b8e1bd976bb317eb8b0d4f (patch) | |
tree | 57cb030d5c5d0f2865c05ea641041634f7855258 /src/map/rodex.c | |
parent | 1a26402c3bd986d0bba0435bfbd62e32abf07302 (diff) | |
download | hercules-bc682624496b854607b8e1bd976bb317eb8b0d4f.tar.gz hercules-bc682624496b854607b8e1bd976bb317eb8b0d4f.tar.bz2 hercules-bc682624496b854607b8e1bd976bb317eb8b0d4f.tar.xz hercules-bc682624496b854607b8e1bd976bb317eb8b0d4f.zip |
Add inventory size field into db and using it in server.
Diffstat (limited to 'src/map/rodex.c')
-rw-r--r-- | src/map/rodex.c | 6 |
1 files changed, 3 insertions, 3 deletions
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) { |