From 2d2db67a5783a4f316c1eb6e9bd9925f360b29a5 Mon Sep 17 00:00:00 2001 From: gumi Date: Wed, 3 Jan 2018 17:59:34 -0500 Subject: remove npc event queue, always clear npc event timer --- src/map/map.hpp | 2 -- src/map/npc.cpp | 8 +++++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/map/map.hpp b/src/map/map.hpp index 44c5bfb..9a184d5 100644 --- a/src/map/map.hpp +++ b/src/map/map.hpp @@ -342,9 +342,7 @@ struct npc_data : block_list bool deletion_pending; - std::list eventqueuel; Array eventtimer; - short arenaflag; private: dumb_ptr as_script(); diff --git a/src/map/npc.cpp b/src/map/npc.cpp index a7cbf5d..8f4e5c7 100644 --- a/src/map/npc.cpp +++ b/src/map/npc.cpp @@ -1026,14 +1026,16 @@ int npc_selllist(dumb_ptr sd, static void npc_free_internal(dumb_ptr nd_) { + for (int i = 0; i < MAX_EVENTTIMER; i++) + { + nd->eventtimer[i].cancel(); + } + if (nd_->npc_subtype == NpcSubtype::SCRIPT) { dumb_ptr nd = nd_->is_script(); nd->scr.timerid.cancel(); nd->scr.timer_eventv.clear(); - nd->eventqueuel.clear(); - for (int i = 0; i < MAX_EVENTTIMER; i++) - nd->eventtimer[i].cancel(); // destroy all children (puppets), if any if (nd_->name && nd->scr.parent == BlockId()) -- cgit v1.2.3-60-g2f50