From 37d3daaf9a5d1b2ceaae4ecfe8e8a5885c575f50 Mon Sep 17 00:00:00 2001 From: Uleat Date: Wed, 3 Sep 2014 23:59:55 -0400 Subject: [PATCH] Client timer issue fix --- changelog.txt | 1 + zone/mob.h | 1 + zone/mob_ai.cpp | 52 ++++++++++++++++++++++++++----------------------- zone/zone.cpp | 1 + 4 files changed, 31 insertions(+), 24 deletions(-) diff --git a/changelog.txt b/changelog.txt index acd869afa..6c2ee0841 100644 --- a/changelog.txt +++ b/changelog.txt @@ -3,6 +3,7 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) == 09/03/2014 == Secrets: Identified the routines needed to augment items in RoF. Currently, only Insert and Remove are supported. Swap and Destroy do not work due to missing functions related to the cursor. demonstar55: Added work around command to show numhits on your buffs (#shownumhits) +Uleat: Fix for timer issue introduced by Zone::ShutDown() fix. == 09/02/2014 == Secrets: Identified OP_GuildPromote for RoF clients. diff --git a/zone/mob.h b/zone/mob.h index 55a57892b..80ecaee49 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -727,6 +727,7 @@ public: virtual void AI_Init(); virtual void AI_Start(uint32 iMoveDelay = 0); virtual void AI_Stop(); + virtual void AI_ShutDown(); virtual void AI_Process(); const char* GetEntityVariable(const char *id); diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index 10d41c78e..125e1d85f 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -550,30 +550,6 @@ void Mob::AI_Stop() { safe_delete(AItarget_check_timer); safe_delete(AIscanarea_timer); safe_delete(AIfeignremember_timer); - safe_delete(PathingLOSCheckTimer); - safe_delete(PathingRouteUpdateTimerShort); - safe_delete(PathingRouteUpdateTimerLong); - - attack_timer.Disable(); - attack_dw_timer.Disable(); - ranged_timer.Disable(); - tic_timer.Disable(); - mana_timer.Disable(); - spellend_timer.Disable(); - projectile_timer.Disable(); - rewind_timer.Disable(); - bindwound_timer.Disable(); - stunned_timer.Disable(); - spun_timer.Disable(); - bardsong_timer.Disable(); - gravity_timer.Disable(); - viral_timer.Disable(); - flee_timer.Disable(); - - for (int sat = 0; sat < MAX_SPECIAL_ATTACK; ++sat) { - if (SpecialAbilities[sat].timer) - SpecialAbilities[sat].timer->Disable(); - } hate_list.Wipe(); } @@ -609,6 +585,34 @@ void Client::AI_Stop() { } } +// only call this on a zone shutdown event +void Mob::AI_ShutDown() { + safe_delete(PathingLOSCheckTimer); + safe_delete(PathingRouteUpdateTimerShort); + safe_delete(PathingRouteUpdateTimerLong); + + attack_timer.Disable(); + attack_dw_timer.Disable(); + ranged_timer.Disable(); + tic_timer.Disable(); + mana_timer.Disable(); + spellend_timer.Disable(); + projectile_timer.Disable(); + rewind_timer.Disable(); + bindwound_timer.Disable(); + stunned_timer.Disable(); + spun_timer.Disable(); + bardsong_timer.Disable(); + gravity_timer.Disable(); + viral_timer.Disable(); + flee_timer.Disable(); + + for (int sat = 0; sat < MAX_SPECIAL_ATTACK; ++sat) { + if (SpecialAbilities[sat].timer) + SpecialAbilities[sat].timer->Disable(); + } +} + //todo: expand the logic here to cover: //redundant debuffs //buffing owner diff --git a/zone/zone.cpp b/zone/zone.cpp index 8f4b211d8..e91e3a4b7 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -733,6 +733,7 @@ void Zone::Shutdown(bool quite) while (mob_itr != mob_list.end()) { Mob* mob_inst = *mob_itr; mob_inst->AI_Stop(); + mob_inst->AI_ShutDown(); ++mob_itr; }