diff options
author | zephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2009-10-04 21:42:15 +0000 |
---|---|---|
committer | zephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2009-10-04 21:42:15 +0000 |
commit | 37a78d0554f4a66793aa2f20694b8716a56b3c25 (patch) | |
tree | 1b208438a1d87960911bee590ddc9d62bf4f5fe8 /src/map/storage.c | |
parent | 6f630e5f6d0082fb105de0b0edb0afe78075abdc (diff) | |
download | hercules-37a78d0554f4a66793aa2f20694b8716a56b3c25.tar.gz hercules-37a78d0554f4a66793aa2f20694b8716a56b3c25.tar.bz2 hercules-37a78d0554f4a66793aa2f20694b8716a56b3c25.tar.xz hercules-37a78d0554f4a66793aa2f20694b8716a56b3c25.zip |
- Implemented new packets for rental items (from Jobbie and Natz and fixed by me).
- Rental items now can be moved to storage and cart.
- Autotrade cannot be used when user is dead, and it's not dispelled if user dies to prevent abuse.
- Fixed pc_checkitem to do a proper item check and remove.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14082 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/storage.c')
-rw-r--r-- | src/map/storage.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/map/storage.c b/src/map/storage.c index f9f695c04..670069915 100644 --- a/src/map/storage.c +++ b/src/map/storage.c @@ -182,7 +182,7 @@ static int storage_additem(struct map_session_data* sd, struct item* item_data, /*========================================== * Internal del-item function *------------------------------------------*/ -static int storage_delitem(struct map_session_data* sd, int n, int amount) +int storage_delitem(struct map_session_data* sd, int n, int amount) { if( sd->status.storage.items[n].nameid == 0 || sd->status.storage.items[n].amount < amount ) return 1; @@ -196,9 +196,9 @@ static int storage_delitem(struct map_session_data* sd, int n, int amount) { memset(&sd->status.storage.items[n],0,sizeof(sd->status.storage.items[0])); sd->status.storage.storage_amount--; - clif_updatestorageamount(sd,sd->status.storage.storage_amount); + if( sd->state.storage_flag == 1 ) clif_updatestorageamount(sd,sd->status.storage.storage_amount); } - clif_storageitemremoved(sd,n,amount); + if( sd->state.storage_flag == 1 ) clif_storageitemremoved(sd,n,amount); return 0; } @@ -218,9 +218,6 @@ int storage_storageadd(struct map_session_data* sd, int index, int amount) if( sd->status.inventory[index].nameid <= 0 ) return 0; // No item on that spot - if( sd->status.inventory[index].expire_time ) - return 0; // Cannot Store Rental Items - if( amount < 1 || amount > sd->status.inventory[index].amount ) return 0; @@ -270,9 +267,6 @@ int storage_storageaddfromcart(struct map_session_data* sd, int index, int amoun if( sd->status.cart[index].nameid <= 0 ) return 0; //No item there. - if( sd->status.inventory[index].expire_time ) - return 0; // Cannot Store Rental Items - if( amount < 1 || amount > sd->status.cart[index].amount ) return 0; |