diff options
author | gumi <mekolat@users.noreply.github.com> | 2017-11-12 22:14:18 -0500 |
---|---|---|
committer | gumi <mekolat@users.noreply.github.com> | 2017-11-12 23:10:14 -0500 |
commit | 35b0508a652811a3872f13a6a161a01fee6f5d1d (patch) | |
tree | 54779cfbb457c11edf8aee47c4dc44738953e8ec /src/map/npc.cpp | |
parent | d0ea54965867c7f93da490b5f1a95f7ac4000bbb (diff) | |
download | tmwa-35b0508a652811a3872f13a6a161a01fee6f5d1d.tar.gz tmwa-35b0508a652811a3872f13a6a161a01fee6f5d1d.tar.bz2 tmwa-35b0508a652811a3872f13a6a161a01fee6f5d1d.tar.xz tmwa-35b0508a652811a3872f13a6a161a01fee6f5d1d.zip |
re-fix the puppet despawn bug
Diffstat (limited to 'src/map/npc.cpp')
-rw-r--r-- | src/map/npc.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/map/npc.cpp b/src/map/npc.cpp index 2600117..32a5a54 100644 --- a/src/map/npc.cpp +++ b/src/map/npc.cpp @@ -675,6 +675,9 @@ int npc_touch_areanpc(dumb_ptr<map_session_data> sd, Borrowed<map_local> m, int for (i = 0; i < m->npc_num; i++) { + if (m->npc[i] == nullptr) + continue; + if (m->npc[i]->flag & 1) continue; @@ -1046,6 +1049,11 @@ void npc_free_internal(dumb_ptr<npc_data> nd_) } if (nd_->name) npcs_by_name.put(nd_->name, nullptr); + + if (nd_->bl_m != borrow(undefined_gat)) { + nd_->bl_m->npc[nd_->n] = nullptr; + } + nd_.delete_(); } |