summaryrefslogtreecommitdiff
path: root/src/map/npc.cpp
diff options
context:
space:
mode:
authorgumi <git@gumi.ca>2018-01-01 16:09:22 -0500
committergumi <git@gumi.ca>2018-01-01 18:09:15 -0500
commitb7ec6e535d314a64aeaf426e2e4c068cd7c4bb34 (patch)
treef29e84563c80e5438da35e608967c33c195dde98 /src/map/npc.cpp
parente808b814cd0899342fcba21cc74ec059772ceb5e (diff)
downloadtmwa-b7ec6e535d314a64aeaf426e2e4c068cd7c4bb34.tar.gz
tmwa-b7ec6e535d314a64aeaf426e2e4c068cd7c4bb34.tar.bz2
tmwa-b7ec6e535d314a64aeaf426e2e4c068cd7c4bb34.tar.xz
tmwa-b7ec6e535d314a64aeaf426e2e4c068cd7c4bb34.zip
release v18.1.1v18.1.1
Diffstat (limited to 'src/map/npc.cpp')
-rw-r--r--src/map/npc.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/map/npc.cpp b/src/map/npc.cpp
index 32a5a54..a7cbf5d 100644
--- a/src/map/npc.cpp
+++ b/src/map/npc.cpp
@@ -358,7 +358,7 @@ void npc_eventtimer(TimerData *, tick_t, BlockId id, NpcEvent data)
data);
return;
});
- if ((nd = ev->nd) == nullptr)
+ if ((nd = ev->nd) == nullptr || nd->deletion_pending == true)
{
if (battle_config.error_log)
PRINTF("npc_event: event not found [%s]\n"_fmt,
@@ -611,7 +611,7 @@ int npc_event(dumb_ptr<map_session_data> sd, NpcEvent eventname,
ev.pos = ev2->pos;
}
- if ((nd = ev.nd) == nullptr)
+ if ((nd = ev.nd) == nullptr || nd->deletion_pending == true)
{
if (!mob_kill && battle_config.error_log)
PRINTF("npc_event: event not found [%s]\n"_fmt,
@@ -1078,6 +1078,10 @@ void npc_propagate_update(dumb_ptr<npc_data> nd)
void npc_free(dumb_ptr<npc_data> nd)
{
+ if (nd == nullptr || nd->deletion_pending == true)
+ return;
+
+ nd->deletion_pending = true;
clif_clearchar(nd, BeingRemoveWhy::GONE);
npc_propagate_update(nd);
map_deliddb(nd);