aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortreeston <treeston.mmoc@gmail.com>2017-07-03 17:49:54 +0200
committerShauren <shauren.trinity@gmail.com>2020-08-18 18:53:13 +0200
commitdaf9c703c45dd102d57b527a78529152819ec67d (patch)
tree4875f5786fa1e83e0953b1fc8ba6fbc516a1dd24 /src
parent2c88d9f162ca158e73bdb03c5ad46c8b6a451d2f (diff)
Two more refactors I missed for #19930. Last ones for now, I promise.
(cherry picked from commit 62d51132524b5afff13371ccd13df556dd545bef)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/AI/CoreAI/UnitAI.h8
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp2
2 files changed, 5 insertions, 5 deletions
diff --git a/src/server/game/AI/CoreAI/UnitAI.h b/src/server/game/AI/CoreAI/UnitAI.h
index 1e4c49c5703..4dd25592677 100644
--- a/src/server/game/AI/CoreAI/UnitAI.h
+++ b/src/server/game/AI/CoreAI/UnitAI.h
@@ -174,7 +174,7 @@ class TC_GAME_API UnitAI
std::list<Unit*> targetList;
if (targetType == SELECT_TARGET_MAXDISTANCE || targetType == SELECT_TARGET_MINDISTANCE)
{
- for (ThreatReference* ref : mgr.GetUnsortedThreatList())
+ for (ThreatReference const* ref : mgr.GetUnsortedThreatList())
{
if (ref->IsOffline())
continue;
@@ -188,7 +188,7 @@ class TC_GAME_API UnitAI
if (currentVictim)
targetList.push_back(currentVictim);
- for (ThreatReference* ref : mgr.GetSortedThreatList())
+ for (ThreatReference const* ref : mgr.GetSortedThreatList())
{
if (ref->IsOffline())
continue;
@@ -263,7 +263,7 @@ class TC_GAME_API UnitAI
if (targetType == SELECT_TARGET_MAXDISTANCE || targetType == SELECT_TARGET_MINDISTANCE)
{
- for (ThreatReference* ref : mgr.GetUnsortedThreatList())
+ for (ThreatReference const* ref : mgr.GetUnsortedThreatList())
{
if (ref->IsOffline())
continue;
@@ -277,7 +277,7 @@ class TC_GAME_API UnitAI
if (currentVictim)
targetList.push_back(currentVictim);
- for (ThreatReference* ref : mgr.GetSortedThreatList())
+ for (ThreatReference const* ref : mgr.GetSortedThreatList())
{
if (ref->IsOffline())
continue;
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp
index 76406958b08..153e37c791f 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp
@@ -445,7 +445,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
if (!me)
break;
- for (auto* ref : me->GetThreatManager().GetUnsortedThreatList())
+ for (auto* ref : me->GetThreatManager().GetModifiableThreatList())
{
ref->ModifyThreatByPercent(std::max<int32>(-100,int32(e.action.threatPCT.threatINC) - int32(e.action.threatPCT.threatDEC)));
TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction:: SMART_ACTION_THREAT_ALL_PCT: Creature %s modify threat for %s, value %i",