summaryrefslogtreecommitdiff
path: root/src/map/unit.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-28 16:09:13 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-28 16:09:13 +0000
commite07b2da8d90f955dbe01737e9bfdb73ddaa3bd83 (patch)
tree2b7773b750e46c8356556a11944f166f3fbbe627 /src/map/unit.c
parent7ab2575a4a3499c642e315d860c82fed60e3d9bb (diff)
downloadhercules-e07b2da8d90f955dbe01737e9bfdb73ddaa3bd83.tar.gz
hercules-e07b2da8d90f955dbe01737e9bfdb73ddaa3bd83.tar.bz2
hercules-e07b2da8d90f955dbe01737e9bfdb73ddaa3bd83.tar.xz
hercules-e07b2da8d90f955dbe01737e9bfdb73ddaa3bd83.zip
- Cleaned up a bit the code for @item
- Fixed character/storage being sent to be saved TWICE when you logged out while the storage is opened. - Added save_settings map config. Specifies after which events do characters get saved (defaults to all): 1 - Trade successful, 2 - Vending transaction, 4 - Closing storage/guild storage, 8 - hatching a pet. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7375 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/unit.c')
-rw-r--r--src/map/unit.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/map/unit.c b/src/map/unit.c
index 0ca1e2559..5137d5f71 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -1508,11 +1508,13 @@ int unit_remove_map(struct block_list *bl, int clrtype) {
trade_tradecancel(sd);
if(sd->vender_id)
vending_closevending(sd);
- if(sd->state.storage_flag == 1)
- storage_storage_quit(sd,0);
- else if (sd->state.storage_flag == 2)
- storage_guild_storage_quit(sd,0);
-
+ if(!sd->state.waitingdisconnect)
+ { //when quitting, let the final chrif_save handle storage saving.
+ if(sd->state.storage_flag == 1)
+ storage_storage_quit(sd,0);
+ else if (sd->state.storage_flag == 2)
+ storage_guild_storage_quit(sd,0);
+ }
if(sd->party_invite>0)
party_reply_invite(sd,sd->party_invite_account,0);
if(sd->guild_invite>0)
@@ -1619,7 +1621,6 @@ int unit_free(struct block_list *bl) {
pc_delspiritball(sd,sd->spiritball,1);
chrif_save_scdata(sd); //Save status changes, then clear'em out from memory. [Skotlex]
pc_makesavestatus(sd);
- sd->state.waitingdisconnect = 1;
pc_clean_skilltree(sd);
} else if( bl->type == BL_PET ) {
struct pet_data *pd = (struct pet_data*)bl;