summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaruna <haru@dotalux.com>2014-12-31 21:10:40 +0100
committerHaruna <haru@dotalux.com>2014-12-31 21:10:40 +0100
commitdc6b470e4aaf252cb4f960b8b5585e51da821893 (patch)
treed21067881f0e5e147efe2f32a91f2425e479b241
parentdb5fd3795cba3d30bb3d031719a272eec23cd586 (diff)
parent9936ef294fcb604c16f447c0353cc6f4c43c6ed8 (diff)
downloadhercules-dc6b470e4aaf252cb4f960b8b5585e51da821893.tar.gz
hercules-dc6b470e4aaf252cb4f960b8b5585e51da821893.tar.bz2
hercules-dc6b470e4aaf252cb4f960b8b5585e51da821893.tar.xz
hercules-dc6b470e4aaf252cb4f960b8b5585e51da821893.zip
Merge pull request #432 from 4144/bugfix1
fix for bug http://hercules.ws/board/tracker/issue-8483-map-crash/
-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;