From 8b5370313dcc00a45ea5c3e8b4c497bc00fd8e13 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Tue, 11 Jun 2013 21:55:13 -0700 Subject: Allegedly remove all manual memory management --- src/map/storage.cpp | 36 +++++------------------------------- 1 file changed, 5 insertions(+), 31 deletions(-) (limited to 'src/map/storage.cpp') diff --git a/src/map/storage.cpp b/src/map/storage.cpp index 463dd7c..5145b80 100644 --- a/src/map/storage.cpp +++ b/src/map/storage.cpp @@ -21,33 +21,6 @@ static Map storage_db; -/*========================================== - * 倉庫内アイテムソート - *------------------------------------------ - */ -static -int storage_comp_item(const void *_i1, const void *_i2) -{ - const struct item *i1 = (const struct item *) _i1; - const struct item *i2 = (const struct item *) _i2; - - if (i1->nameid == i2->nameid) - return 0; - else if (!(i1->nameid) || !(i1->amount)) - return 1; - else if (!(i2->nameid) || !(i2->amount)) - return -1; - return i1->nameid - i2->nameid; -} - -static -void sortage_sortitem(struct storage *stor) -{ - nullpo_retv(stor); - qsort(stor->storage_, MAX_STORAGE, sizeof(struct item), - storage_comp_item); -} - void do_init_storage(void) { } @@ -328,14 +301,15 @@ int storage_storage_save(int account_id, int final) //Ack from Char-server indicating the storage was saved. [Skotlex] int storage_storage_saved(int account_id) { - struct storage *stor; + struct storage *stor = account2storage2(account_id); - if ((stor = account2storage2(account_id)) != NULL) - { //Only mark it clean if it's not in use. [Skotlex] + if (stor) + { + //Only mark it clean if it's not in use. [Skotlex] if (stor->dirty && stor->storage_status == 0) { stor->dirty = 0; - sortage_sortitem(stor); + // sortage_sortitem(stor); } return 1; } -- cgit v1.2.3-60-g2f50