mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Two more refactors I missed for #19930. Last ones for now, I promise.
This commit is contained in:
@@ -173,7 +173,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;
|
||||
@@ -187,7 +187,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;
|
||||
@@ -262,7 +262,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;
|
||||
@@ -276,7 +276,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;
|
||||
|
||||
@@ -459,7 +459,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 guidLow %u modify threat for unit %u, value %i",
|
||||
|
||||
Reference in New Issue
Block a user