From 18fb86a5607e3bc5e3c1cb38a5796f8eb15f54ec Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Mon, 22 Dec 2014 01:58:54 -0500 Subject: [PATCH] Force changing the timer_time for attack timers Should fix issues with waiting for a slow timer after a cure --- common/timer.cpp | 4 +++- common/timer.h | 2 +- zone/attack.cpp | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/common/timer.cpp b/common/timer.cpp index c1c94a7f6..d5a90a0f2 100644 --- a/common/timer.cpp +++ b/common/timer.cpp @@ -141,11 +141,13 @@ uint32 Timer::GetRemainingTime() { } } -void Timer::SetAtTrigger(uint32 in_set_at_trigger, bool iEnableIfDisabled) { +void Timer::SetAtTrigger(uint32 in_set_at_trigger, bool iEnableIfDisabled, bool ChangeTimerTime) { set_at_trigger = in_set_at_trigger; if (!Enabled() && iEnableIfDisabled) { Enable(); } + if (ChangeTimerTime) + timer_time = set_at_trigger; } void Timer::Trigger() diff --git a/common/timer.h b/common/timer.h index 1e3ab97e0..c4d89fe11 100644 --- a/common/timer.h +++ b/common/timer.h @@ -43,7 +43,7 @@ public: inline const uint32& GetTimerTime() { return timer_time; } inline const uint32& GetSetAtTrigger() { return set_at_trigger; } void Trigger(); - void SetAtTrigger(uint32 set_at_trigger, bool iEnableIfDisabled = false); + void SetAtTrigger(uint32 set_at_trigger, bool iEnableIfDisabled = false, bool ChangeTimerTime = false); inline bool Enabled() { return enabled; } inline uint32 GetStartTime() { return(start_time); } diff --git a/zone/attack.cpp b/zone/attack.cpp index 2bd3a0247..5f4835395 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -4932,7 +4932,7 @@ void Client::SetAttackTimer() // this is probably wrong if (quiver_haste > 0) speed *= quiver_haste; - TimerToUse->SetAtTrigger(std::max(RuleI(Combat, MinHastedDelay), speed), true); + TimerToUse->SetAtTrigger(std::max(RuleI(Combat, MinHastedDelay), speed), true, true); if (i == MainPrimary) PrimaryWeapon = ItemToUse; @@ -4980,6 +4980,6 @@ void NPC::SetAttackTimer() } } - TimerToUse->SetAtTrigger(std::max(RuleI(Combat, MinHastedDelay), speed), true); + TimerToUse->SetAtTrigger(std::max(RuleI(Combat, MinHastedDelay), speed), true, true); } }