diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-06-29 15:53:30 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-06-29 15:53:30 +0000 |
commit | adf2854618745572b076a2b4a6343e63374c1182 (patch) | |
tree | d9205c4b2153667b9575b7a5d9d5e98b9ecef861 /src/map/storage.c | |
parent | b7158940b46b4a7cc3ad795eb90a0d896936a644 (diff) | |
download | hercules-adf2854618745572b076a2b4a6343e63374c1182.tar.gz hercules-adf2854618745572b076a2b4a6343e63374c1182.tar.bz2 hercules-adf2854618745572b076a2b4a6343e63374c1182.tar.xz hercules-adf2854618745572b076a2b4a6343e63374c1182.zip |
- Fixed guild storage being "eternally in use" if you quit/logout before closing it.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7395 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/storage.c')
-rw-r--r-- | src/map/storage.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/map/storage.c b/src/map/storage.c index 0be5d756d..29b48527d 100644 --- a/src/map/storage.c +++ b/src/map/storage.c @@ -76,7 +76,7 @@ static int storage_reconnect_sub(DBKey key,void *data,va_list ap) { //Guild Storage
struct guild_storage* stor = (struct guild_storage*) data;
if (stor->dirty && stor->storage_status == 0) //Save closed storages.
- storage_guild_storagesave(0, stor->guild_id);
+ storage_guild_storagesave(0, stor->guild_id,0);
}
else
{ //Account Storage
@@ -674,13 +674,16 @@ int storage_guild_storagegettocart(struct map_session_data *sd,int index,int amo return 1;
}
-int storage_guild_storagesave(int account_id, int guild_id)
+int storage_guild_storagesave(int account_id, int guild_id, int flag)
{
struct guild_storage *stor = guild2storage2(guild_id);
- if(stor && stor->dirty)
+ if(stor)
{
- intif_send_guild_storage(account_id,stor);
+ if (flag) //Char quitting, close it.
+ stor->storage_status = 0;
+ if (stor->dirty)
+ intif_send_guild_storage(account_id,stor);
return 1;
}
return 0;
@@ -714,7 +717,7 @@ int storage_guild_storageclose(struct map_session_data *sd) if (save_settings&4)
chrif_save(sd, 0); //This one also saves the storage. [Skotlex]
else
- storage_guild_storagesave(sd->status.account_id, sd->status.guild_id);
+ storage_guild_storagesave(sd->status.account_id, sd->status.guild_id,0);
}
stor->storage_status=0;
sd->state.storage_flag = 0;
@@ -743,7 +746,7 @@ int storage_guild_storage_quit(struct map_session_data *sd,int flag) if (save_settings&4)
chrif_save(sd,0);
else
- storage_guild_storagesave(sd->status.account_id,sd->status.guild_id);
+ storage_guild_storagesave(sd->status.account_id,sd->status.guild_id,1);
}
sd->state.storage_flag = 0;
stor->storage_status = 0;
|