From 4b825f68fa8e8ec86d6aa1694f629ed348fe50f1 Mon Sep 17 00:00:00 2001 From: Dennis Friis Date: Tue, 23 Jun 2009 00:22:39 +0200 Subject: Redo storage, derived from ea stable. --- src/map/pc.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/map/pc.c') diff --git a/src/map/pc.c b/src/map/pc.c index 4ad09a3..537e978 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -3485,8 +3485,16 @@ int pc_setpos(struct map_session_data *sd,char *mapname_org,int x,int y,int clrt sd->bl.y=y; sd->state.waitingdisconnect=1; pc_makesavestatus(sd); - chrif_save(sd); - storage_storage_save(sd); + //The storage close routines save the char data. [Skotlex] + if (!sd->state.storage_flag) + chrif_save(sd); + else if (sd->state.storage_flag == 1) + { + storage_storageclose(sd); + storage_delete(sd->status.account_id); + } + else if (sd->state.storage_flag == 2) + storage_guild_storageclose(sd); chrif_changemapserver(sd, mapname, x, y, ip, port); return 0; } @@ -7180,7 +7188,6 @@ static int pc_autosave_sub(struct map_session_data *sd,va_list ap) pc_makesavestatus(sd); chrif_save(sd); - storage_storage_save(sd); for(i=0;i