[Bug Fix] Fix an issue where EVENT_TIMER timers would not be cleaned up after zone (#3018)

* [Bug Fix] Dangling client timers fixed.

* Remove all timers from mob in destructor instead of in QuestMgr::Process
This commit is contained in:
Paul Coene 2023-03-03 12:54:14 -05:00 committed by GitHub
parent a97a9a0d1c
commit 748602b04e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -518,7 +518,9 @@ Mob::Mob(
}
Mob::~Mob()
{
{
quest_manager.stopalltimers(this);
mMovementManager->RemoveMob(this);
AI_Stop();

View File

@ -88,7 +88,7 @@ void QuestManager::Process() {
end = QTimerList.end();
while (cur != end) {
if (cur->Timer_.Enabled() && cur->Timer_.Check()) {
if (cur->mob && entity_list.IsMobInZone(cur->mob)) {
if (cur->mob) {
if (cur->mob->IsNPC()) {
if (parse->HasQuestSub(cur->mob->GetNPCTypeID(), EVENT_TIMER)) {
parse->EventNPC(EVENT_TIMER, cur->mob->CastToNPC(), nullptr, cur->name, 0);