From 47b13bf73ad5e55e106ffe92489c664c2077aeb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E4=BD=A9=E8=8C=B9?= Date: Tue, 28 Mar 2023 13:00:57 -0600 Subject: [PATCH] Revert "Fix GetTargetIcons calls (thanks xuanfeng66)" This reverts commit 4abe553f2743f43e774a4c8f322398195afc7a32. --- src/ChatFilter.cpp | 2 +- src/strategy/actions/RtiAction.cpp | 2 +- src/strategy/values/AttackersValue.cpp | 2 +- src/strategy/values/DpsTargetValue.cpp | 4 ++-- src/strategy/values/RtiTargetValue.cpp | 2 +- src/strategy/values/TargetValue.cpp | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ChatFilter.cpp b/src/ChatFilter.cpp index ed8f7fdc..b8b247a7 100644 --- a/src/ChatFilter.cpp +++ b/src/ChatFilter.cpp @@ -163,7 +163,7 @@ class RtiChatFilter : public ChatFilter if (!isRti) continue; - ObjectGuid rtiTarget = group->GetTargetIcons()[RtiTargetValue::GetRtiIndex(rti.substr(1))]; + ObjectGuid rtiTarget = group->GetTargetIcon(RtiTargetValue::GetRtiIndex(rti.substr(1))); if (bot->GetGUID() == rtiTarget) return ChatFilter::Filter(message); diff --git a/src/strategy/actions/RtiAction.cpp b/src/strategy/actions/RtiAction.cpp index ac695ef4..d0b71a92 100644 --- a/src/strategy/actions/RtiAction.cpp +++ b/src/strategy/actions/RtiAction.cpp @@ -75,7 +75,7 @@ bool MarkRtiAction::Execute(Event event) bool marked = false; for (uint8 i = 0; i < 8; i++) { - ObjectGuid iconGUID = group->GetTargetIcons()[i]; + ObjectGuid iconGUID = group->GetTargetIcon(i); if (guid == unit->GetGUID()) { marked = true; diff --git a/src/strategy/values/AttackersValue.cpp b/src/strategy/values/AttackersValue.cpp index b3c7c7c4..f87baf32 100644 --- a/src/strategy/values/AttackersValue.cpp +++ b/src/strategy/values/AttackersValue.cpp @@ -101,7 +101,7 @@ bool AttackersValue::IsPossibleTarget(Unit* attacker, Player* bot, float range) Creature* c = attacker->ToCreature(); bool rti = false; if (attacker && bot->GetGroup()) - rti = bot->GetGroup()->GetTargetIcons()[7] == attacker->GetGUID(); + rti = bot->GetGroup()->GetTargetIcon(7) == attacker->GetGUID(); PlayerbotAI* botAI = GET_PLAYERBOT_AI(bot); diff --git a/src/strategy/values/DpsTargetValue.cpp b/src/strategy/values/DpsTargetValue.cpp index 09bc6caf..6f3a085b 100644 --- a/src/strategy/values/DpsTargetValue.cpp +++ b/src/strategy/values/DpsTargetValue.cpp @@ -14,7 +14,7 @@ class FindLeastHpTargetStrategy : public FindTargetStrategy { if (Group* group = botAI->GetBot()->GetGroup()) { - ObjectGuid guid = group->GetTargetIcons()[4]; + ObjectGuid guid = group->GetTargetIcon(4); if (guid && attacker->GetGUID() == guid) return; } @@ -46,7 +46,7 @@ class FindMaxHpTargetStrategy : public FindTargetStrategy { if (Group* group = botAI->GetBot()->GetGroup()) { - ObjectGuid guid = group->GetTargetIcons()[4]; + ObjectGuid guid = group->GetTargetIcon(4); if (guid && attacker->GetGUID() == guid) return; } diff --git a/src/strategy/values/RtiTargetValue.cpp b/src/strategy/values/RtiTargetValue.cpp index fbab68c6..40f5eee7 100644 --- a/src/strategy/values/RtiTargetValue.cpp +++ b/src/strategy/values/RtiTargetValue.cpp @@ -41,7 +41,7 @@ Unit* RtiTargetValue::Calculate() if (index == -1) return nullptr; - ObjectGuid guid = group->GetTargetIcons()[index]; + ObjectGuid guid = group->GetTargetIcon(index); if (!guid) return nullptr; diff --git a/src/strategy/values/TargetValue.cpp b/src/strategy/values/TargetValue.cpp index 83ddd4f9..f56bdc99 100644 --- a/src/strategy/values/TargetValue.cpp +++ b/src/strategy/values/TargetValue.cpp @@ -49,14 +49,14 @@ bool FindNonCcTargetStrategy::IsCcTarget(Unit* attacker) int32 index = RtiTargetValue::GetRtiIndex(rti); if (index != -1) { - if (ObjectGuid guid = group->GetTargetIcons()[index]) + if (ObjectGuid guid = group->GetTargetIcon(index)) if (attacker->GetGUID() == guid) return true; } } } - if (ObjectGuid guid = group->GetTargetIcons()[4]) + if (ObjectGuid guid = group->GetTargetIcon(4)) if (attacker->GetGUID() == guid) return true; }