aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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",