From e07b2da8d90f955dbe01737e9bfdb73ddaa3bd83 Mon Sep 17 00:00:00 2001 From: skotlex Date: Wed, 28 Jun 2006 16:09:13 +0000 Subject: - 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 --- src/map/unit.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/map/unit.c') 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; -- cgit v1.2.3-60-g2f50