summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/map/pc.h1
-rw-r--r--src/map/status.c2
-rw-r--r--src/map/unit.c2
3 files changed, 4 insertions, 1 deletions
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);