mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Fix GetTargetIcons calls (thanks xuanfeng66)
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user