summaryrefslogtreecommitdiff
path: root/src/map/storage.c
diff options
context:
space:
mode:
authormomacabu <momacabu@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-12-19 21:01:03 +0000
committermomacabu <momacabu@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-12-19 21:01:03 +0000
commit6b5b18378c89aa875c98e8323082856ec49c127f (patch)
treef6666c1b1c8616d55607033a5103b87e7db70474 /src/map/storage.c
parent3e909f3c4a25d5f550dccf1b7a98922c80a90416 (diff)
downloadhercules-6b5b18378c89aa875c98e8323082856ec49c127f.tar.gz
hercules-6b5b18378c89aa875c98e8323082856ec49c127f.tar.bz2
hercules-6b5b18378c89aa875c98e8323082856ec49c127f.tar.xz
hercules-6b5b18378c89aa875c98e8323082856ec49c127f.zip
Implemented @clearstorage, @cleargstorage, @clearcart, @clearinventory (alias for @itemreset) as suggested in tid:70764.
For further details read the documentation in doc/atcommands.txt git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@17029 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/storage.c')
-rw-r--r--src/map/storage.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/map/storage.c b/src/map/storage.c
index c66f12852..eb7760a0f 100644
--- a/src/map/storage.c
+++ b/src/map/storage.c
@@ -405,6 +405,9 @@ int storage_guild_storageopen(struct map_session_data* sd)
}
if(gstor->storage_status)
return 1;
+
+ if( gstor->lock )
+ return 1;
gstor->storage_status = 1;
sd->state.storage_flag = 2;
@@ -522,6 +525,11 @@ int storage_guild_storageadd(struct map_session_data* sd, int index, int amount)
if( amount < 1 || amount > sd->status.inventory[index].amount )
return 0;
+
+ if( stor->lock ) {
+ storage_guild_storageclose(sd);
+ return 0;
+ }
if(guild_storage_additem(sd,stor,&sd->status.inventory[index],amount)==0)
pc_delitem(sd,index,amount,0,4,LOG_TYPE_GSTORAGE);
@@ -555,6 +563,11 @@ int storage_guild_storageget(struct map_session_data* sd, int index, int amount)
if(amount < 1 || amount > stor->items[index].amount)
return 0;
+
+ if( stor->lock ) {
+ storage_guild_storageclose(sd);
+ return 0;
+ }
if((flag = pc_additem(sd,&stor->items[index],amount,LOG_TYPE_GSTORAGE)) == 0)
guild_storage_delitem(sd,stor,index,amount);