From 817d8ceb64e44e86b82d4998e2e6b4c08330745e Mon Sep 17 00:00:00 2001 From: Uleat Date: Fri, 25 Mar 2016 02:04:25 -0400 Subject: [PATCH] Fix for heal rotation 'Stack Overflow' error --- changelog.txt | 3 +++ zone/heal_rotation.cpp | 8 ++++++-- zone/heal_rotation.h | 2 ++ zone/mob.cpp | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/changelog.txt b/changelog.txt index 174196c4f..09ba48d3b 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,8 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 03/25/2016 == +Uleat: Fix for heal rotation 'Stack Overflow' error + == 03/24/2016 == Kayen: Fix for AE taunt to use correct range and hate modifier. Fix for spell effect version of taunt to use correct range. diff --git a/zone/heal_rotation.cpp b/zone/heal_rotation.cpp index e99b6560d..a88cdd1ed 100644 --- a/zone/heal_rotation.cpp +++ b/zone/heal_rotation.cpp @@ -47,6 +47,8 @@ HealRotation::HealRotation(Bot* hr_creator, uint32 interval_ms, bool fast_heals, ResetArmorTypeHPLimits(); m_is_active = false; + + m_consumed = false; } void HealRotation::SetIntervalMS(uint32 interval_ms) @@ -502,8 +504,10 @@ bool HealRotation::valid_state() cycle_refresh(); - if (m_member_pool.empty()) - ClearTargetPool(); // Consumes HealRotation at this point + if (m_member_pool.empty() && !m_consumed) { // Consumes HealRotation at this point + m_consumed = true; + ClearTargetPool(); + } return (!m_member_pool.empty()); } diff --git a/zone/heal_rotation.h b/zone/heal_rotation.h index 460179719..3c3006c87 100644 --- a/zone/heal_rotation.h +++ b/zone/heal_rotation.h @@ -127,6 +127,8 @@ private: bool m_is_active; + bool m_consumed; + std::list m_member_pool; std::list m_cycle_pool; std::list m_target_pool; diff --git a/zone/mob.cpp b/zone/mob.cpp index 746f68b5f..0429cc973 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -5891,7 +5891,7 @@ bool Mob::LeaveHealRotationTargetPool() m_target_of_heal_rotation->RemoveTargetFromPool(this); m_target_of_heal_rotation.reset(); - + return !IsHealRotationTarget(); }