summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorDennis Friis <peavey@inspircd.org>2009-06-23 01:45:20 +0200
committerDennis Friis <peavey@inspircd.org>2009-06-25 01:13:20 +0200
commit88d74cb2f179b074d5a81df60c2eb95f6873cf8e (patch)
tree2d715928b180000c69d0fbc63f023b9dbdc89835 /src/map
parent2f8f562c2c85aaff8fe2f12c2f4ab3092f53bd9c (diff)
downloadtmwa-88d74cb2f179b074d5a81df60c2eb95f6873cf8e.tar.gz
tmwa-88d74cb2f179b074d5a81df60c2eb95f6873cf8e.tar.bz2
tmwa-88d74cb2f179b074d5a81df60c2eb95f6873cf8e.tar.xz
tmwa-88d74cb2f179b074d5a81df60c2eb95f6873cf8e.zip
Make opening storage fail if there is a storage already open. Derived from ea stable.
Diffstat (limited to 'src/map')
-rw-r--r--src/map/storage.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/map/storage.c b/src/map/storage.c
index 50f0bef..dc9f714 100644
--- a/src/map/storage.c
+++ b/src/map/storage.c
@@ -147,7 +147,7 @@ int storage_storageopen(struct map_session_data *sd)
//Storage loading always from sql idea from Komurka [Skotlex] - removed as it opens exploits when server lags.
//#ifdef TXT_ONLY
if((stor = (struct storage *) numdb_search(storage_db,sd->status.account_id)) != NULL) {
- if (stor->storage_status == 0) {
+ if (stor->storage_status == 0 && sd->state.storage_flag == 0) {
stor->storage_status = 1;
sd->state.storage_flag = 1;
clif_storageitemlist(sd,stor);
@@ -457,6 +457,8 @@ int storage_guild_storageopen(struct map_session_data *sd)
if((gstor = guild2storage2(sd->status.guild_id)) != NULL) {
if(gstor->storage_status)
return 1;
+ if(sd->state.storage_flag)
+ return 1; //Can't open both storages at a time.
gstor->storage_status = 1;
sd->state.storage_flag = 2;
clif_guildstorageitemlist(sd,gstor);