summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/emap/map.c6
-rw-r--r--src/emap/npc.c1
2 files changed, 7 insertions, 0 deletions
diff --git a/src/emap/map.c b/src/emap/map.c
index 4125636..1fc0132 100644
--- a/src/emap/map.c
+++ b/src/emap/map.c
@@ -603,6 +603,12 @@ void map_alwaysVisible_send(TBL_PC *sd)
{
const int id = VECTOR_INDEX(data->npcs, f);
TBL_NPC *npc = map->id2nd(id);
+ if (npc == NULL)
+ {
+ ShowError("npc present in always visible list "
+ "but not in map: id=%d\n", id);
+ continue;
+ }
clif->set_unit_idle(&npc->bl, sd, SELF);
clif->charnameack(sd->fd, &npc->bl);
}
diff --git a/src/emap/npc.c b/src/emap/npc.c
index 5dee49d..e3a3a20 100644
--- a/src/emap/npc.c
+++ b/src/emap/npc.c
@@ -268,6 +268,7 @@ int enpc_unload_pre(struct npc_data** ndPtr,
{
struct npc_data *nd = *ndPtr;
nullpo_ret(nd);
+ map_alwaysVisible_delete(&nd->bl);
if (nd->subtype == SCRIPT)
{
if (nd->src_id != 0)