From 73ab0c441de0f74c2e621a594df7e269ce89bfc5 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Mon, 10 Mar 2014 17:03:08 -0300 Subject: Fixed Bug 8046 Fixed issue with permanent statuses being removed during logout for memory-freeing operations, special thanks to streusel and all those who contributed to the bug report. http://hercules.ws/board/tracker/issue-8046-cart-disappearance/ Signed-off-by: shennetsind --- src/map/pc.h | 1 + src/map/status.c | 2 +- src/map/unit.c | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/map/pc.h b/src/map/pc.h index 66915492a..cc95b07e1 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -187,6 +187,7 @@ struct map_session_data { unsigned int hpmeter_visible : 1; unsigned int itemcheck : 1; unsigned int standalone : 1;/* [Ind/Hercules <3] */ + unsigned int loggingout : 1; } state; struct { unsigned char no_weapon_damage, no_magic_damage, no_misc_damage; diff --git a/src/map/status.c b/src/map/status.c index 5dcf35198..f23a48fe0 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -9605,7 +9605,7 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const if (sce->timer != tid && tid != INVALID_TIMER) return 0; - if( sd && sce->timer == INVALID_TIMER ) + if( sd && sce->timer == INVALID_TIMER && !sd->state.loggingout ) chrif->del_scdata_single(sd->status.account_id,sd->status.char_id,type); if (tid == INVALID_TIMER) { diff --git a/src/map/unit.c b/src/map/unit.c index 47cf07ef6..5dd63879f 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -2330,6 +2330,8 @@ int unit_free(struct block_list *bl, clr_type clrtype) { int i; unsigned int k; + sd->state.loggingout = 1; + if( status->isdead(bl) ) pc->setrestartvalue(sd,2); -- cgit v1.2.3-60-g2f50