diff options
author | Kevin <Kevin@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-04-27 07:18:21 +0000 |
---|---|---|
committer | Kevin <Kevin@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-04-27 07:18:21 +0000 |
commit | 677598256feaad3bcef53805ad8c70e744a9b7d3 (patch) | |
tree | 3a4b061dc62ac53fbd80c1434990a47dca0d54d9 /src/map/clif.c | |
parent | ab60cf06afb586b106991b4b9848dd9c107ddec2 (diff) | |
download | hercules-677598256feaad3bcef53805ad8c70e744a9b7d3.tar.gz hercules-677598256feaad3bcef53805ad8c70e744a9b7d3.tar.bz2 hercules-677598256feaad3bcef53805ad8c70e744a9b7d3.tar.xz hercules-677598256feaad3bcef53805ad8c70e744a9b7d3.zip |
Some major changes to @reloaditemdb to allow unloading of any item while map server is running.
- Delete any item from inventory/cart/open storages that went missing during the reload.
- Delete item from any shop that has this item.
- Refresh item screen for anyone who has a shop open.
- Delete mob db drop table references.
- Delete item from storage during load if it isn't in the item db.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12661 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/clif.c')
-rw-r--r-- | src/map/clif.c | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 55e9b1776..66a01b867 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -1894,20 +1894,27 @@ void clif_storagelist(struct map_session_data *sd,struct storage *stor) if(stor->storage_[i].nameid<=0) continue; id = itemdb_search(stor->storage_[i].nameid); - if(!itemdb_isstackable2(id)) - { //Equippable - WBUFW(bufe,ne*20+4)=i+1; - clif_item_sub(bufe, ne*20+6, &stor->storage_[i], id, id->equip); - clif_addcards(WBUFP(bufe, ne*20+16), &stor->storage_[i]); - ne++; - } else { //Stackable - WBUFW(buf,n*s+4)=i+1; - clif_item_sub(buf, n*s+6, &stor->storage_[i], id,-1); + if(!id) + { + //Item not found, was probably deleted and then map server reloaded/item db reloaded + storage_delitem(sd, stor, i, stor->storage_[i].amount); + return; + } + else + if(!itemdb_isstackable2(id)) + { //Equippable + WBUFW(bufe,ne*20+4)=i+1; + clif_item_sub(bufe, ne*20+6, &stor->storage_[i], id, id->equip); + clif_addcards(WBUFP(bufe, ne*20+16), &stor->storage_[i]); + ne++; + } else { //Stackable + WBUFW(buf,n*s+4)=i+1; + clif_item_sub(buf, n*s+6, &stor->storage_[i], id,-1); #if PACKETVER >= 5 - clif_addcards(WBUFP(buf,n*s+14), &stor->storage_[i]); + clif_addcards(WBUFP(buf,n*s+14), &stor->storage_[i]); #endif - n++; - } + n++; + } } if(n){ #if PACKETVER < 5 |