summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/npc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index 8b5bbc83e..6762684af 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -987,6 +987,12 @@ int npc_untouch_areanpc(struct map_session_data* sd, int16 m, int16 x, int16 y)
return 0;
nd = (struct npc_data *) map->id2bl(sd->areanpc_id);
+ if (!nd)
+ {
+ sd->areanpc_id = 0;
+ return 1;
+ }
+
npc->onuntouch_event(sd, nd);
sd->areanpc_id = 0;
return 0;