mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-25 03:12:09 +01:00
Two more refactors I missed for #19930. Last ones for now, I promise.
This commit is contained in:
@@ -172,7 +172,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;
|
||||
@@ -186,7 +186,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;
|
||||
@@ -261,7 +261,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;
|
||||
@@ -275,7 +275,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;
|
||||
|
||||
@@ -494,7 +494,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