summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/map/npc.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index f5a1bfc09..d4f0036bb 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -1458,9 +1458,12 @@ int npc_unload(struct npc_data* nd)
struct map_session_data *sd = map_id2sd(bl->id);
if( sd && sd->npc_timer_id != INVALID_TIMER )
{
- const struct TimerData *td = NULL;
- td = get_timer(sd->npc_timer_id);
- if (td && td->data)
+ const struct TimerData *td = get_timer(sd->npc_timer_id);
+
+ if( td && td->id == nd->bl.id )
+ continue;
+
+ if( td && td->data )
ers_free(timer_event_ers, (void*)td->data);
delete_timer(sd->npc_timer_id, npc_timerevent);
sd->npc_timer_id = INVALID_TIMER;