aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Combat/ThreatManager.cpp
diff options
context:
space:
mode:
authorTreeston <treeston.mmoc@gmail.com>2018-01-09 23:55:57 +0100
committerTreeston <treeston.mmoc@gmail.com>2018-01-09 23:56:17 +0100
commitb53cbf467b445a9b57a5567f88a26f77289f7fe1 (patch)
tree0313ed772ad90ec01d3b79a494e093f293976fbf /src/server/game/Combat/ThreatManager.cpp
parent2c0f12602ae940479bd5e4f7578b4d64d47370ba (diff)
3dcd49e v2, slightly cheaper
Diffstat (limited to 'src/server/game/Combat/ThreatManager.cpp')
-rw-r--r--src/server/game/Combat/ThreatManager.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/server/game/Combat/ThreatManager.cpp b/src/server/game/Combat/ThreatManager.cpp
index b7f1aec9854..c7e36557b30 100644
--- a/src/server/game/Combat/ThreatManager.cpp
+++ b/src/server/game/Combat/ThreatManager.cpp
@@ -333,10 +333,10 @@ void ThreatManager::AddThreat(Unit* target, float amount, SpellInfo const* spell
if (!redirInfo.empty())
{
float const origAmount = amount;
- // intentional copy - there's a nested AddThreat call further down that might cause AI calls which cast spells
- auto const redirects = redirInfo;
- for (auto const& pair : redirects) // (victim,pct)
+ // intentional iteration by index - there's a nested AddThreat call further down that might cause AI calls which might modify redirect info through spells
+ for (size_t i=0; i<redirInfo.size(); ++i)
{
+ auto const pair = redirInfo[i]; // (victim,pct)
Unit* redirTarget = nullptr;
auto it = _myThreatListEntries.find(pair.first); // try to look it up in our threat list first (faster)
if (it != _myThreatListEntries.end())