Fix GetTargetIcons calls (thanks xuanfeng66)

This commit is contained in:
郑佩茹
2023-03-28 09:30:11 -06:00
parent 256b8c79f9
commit 4abe553f27
6 changed files with 8 additions and 8 deletions

View File

@@ -163,7 +163,7 @@ class RtiChatFilter : public ChatFilter
if (!isRti)
continue;
ObjectGuid rtiTarget = group->GetTargetIcon(RtiTargetValue::GetRtiIndex(rti.substr(1)));
ObjectGuid rtiTarget = group->GetTargetIcons()[RtiTargetValue::GetRtiIndex(rti.substr(1))];
if (bot->GetGUID() == rtiTarget)
return ChatFilter::Filter(message);

View File

@@ -75,7 +75,7 @@ bool MarkRtiAction::Execute(Event event)
bool marked = false;
for (uint8 i = 0; i < 8; i++)
{
ObjectGuid iconGUID = group->GetTargetIcon(i);
ObjectGuid iconGUID = group->GetTargetIcons()[i];
if (guid == unit->GetGUID())
{
marked = true;

View File

@@ -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()->GetTargetIcon(7) == attacker->GetGUID();
rti = bot->GetGroup()->GetTargetIcons()[7] == attacker->GetGUID();
PlayerbotAI* botAI = GET_PLAYERBOT_AI(bot);

View File

@@ -14,7 +14,7 @@ class FindLeastHpTargetStrategy : public FindTargetStrategy
{
if (Group* group = botAI->GetBot()->GetGroup())
{
ObjectGuid guid = group->GetTargetIcon(4);
ObjectGuid guid = group->GetTargetIcons()[4];
if (guid && attacker->GetGUID() == guid)
return;
}
@@ -46,7 +46,7 @@ class FindMaxHpTargetStrategy : public FindTargetStrategy
{
if (Group* group = botAI->GetBot()->GetGroup())
{
ObjectGuid guid = group->GetTargetIcon(4);
ObjectGuid guid = group->GetTargetIcons()[4];
if (guid && attacker->GetGUID() == guid)
return;
}

View File

@@ -41,7 +41,7 @@ Unit* RtiTargetValue::Calculate()
if (index == -1)
return nullptr;
ObjectGuid guid = group->GetTargetIcon(index);
ObjectGuid guid = group->GetTargetIcons()[index];
if (!guid)
return nullptr;

View File

@@ -49,14 +49,14 @@ bool FindNonCcTargetStrategy::IsCcTarget(Unit* attacker)
int32 index = RtiTargetValue::GetRtiIndex(rti);
if (index != -1)
{
if (ObjectGuid guid = group->GetTargetIcon(index))
if (ObjectGuid guid = group->GetTargetIcons()[index])
if (attacker->GetGUID() == guid)
return true;
}
}
}
if (ObjectGuid guid = group->GetTargetIcon(4))
if (ObjectGuid guid = group->GetTargetIcons()[4])
if (attacker->GetGUID() == guid)
return true;
}