From 37a78d0554f4a66793aa2f20694b8716a56b3c25 Mon Sep 17 00:00:00 2001 From: zephyrus Date: Sun, 4 Oct 2009 21:42:15 +0000 Subject: - 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 --- src/map/storage.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/map/storage.c') 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; -- cgit v1.2.3-70-g09d2