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)
|
if (!isRti)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ObjectGuid rtiTarget = group->GetTargetIcon(RtiTargetValue::GetRtiIndex(rti.substr(1)));
|
ObjectGuid rtiTarget = group->GetTargetIcons()[RtiTargetValue::GetRtiIndex(rti.substr(1))];
|
||||||
if (bot->GetGUID() == rtiTarget)
|
if (bot->GetGUID() == rtiTarget)
|
||||||
return ChatFilter::Filter(message);
|
return ChatFilter::Filter(message);
|
||||||
|
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ bool MarkRtiAction::Execute(Event event)
|
|||||||
bool marked = false;
|
bool marked = false;
|
||||||
for (uint8 i = 0; i < 8; i++)
|
for (uint8 i = 0; i < 8; i++)
|
||||||
{
|
{
|
||||||
ObjectGuid iconGUID = group->GetTargetIcon(i);
|
ObjectGuid iconGUID = group->GetTargetIcons()[i];
|
||||||
if (guid == unit->GetGUID())
|
if (guid == unit->GetGUID())
|
||||||
{
|
{
|
||||||
marked = true;
|
marked = true;
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ bool AttackersValue::IsPossibleTarget(Unit* attacker, Player* bot, float range)
|
|||||||
Creature* c = attacker->ToCreature();
|
Creature* c = attacker->ToCreature();
|
||||||
bool rti = false;
|
bool rti = false;
|
||||||
if (attacker && bot->GetGroup())
|
if (attacker && bot->GetGroup())
|
||||||
rti = bot->GetGroup()->GetTargetIcon(7) == attacker->GetGUID();
|
rti = bot->GetGroup()->GetTargetIcons()[7] == attacker->GetGUID();
|
||||||
|
|
||||||
PlayerbotAI* botAI = GET_PLAYERBOT_AI(bot);
|
PlayerbotAI* botAI = GET_PLAYERBOT_AI(bot);
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class FindLeastHpTargetStrategy : public FindTargetStrategy
|
|||||||
{
|
{
|
||||||
if (Group* group = botAI->GetBot()->GetGroup())
|
if (Group* group = botAI->GetBot()->GetGroup())
|
||||||
{
|
{
|
||||||
ObjectGuid guid = group->GetTargetIcon(4);
|
ObjectGuid guid = group->GetTargetIcons()[4];
|
||||||
if (guid && attacker->GetGUID() == guid)
|
if (guid && attacker->GetGUID() == guid)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -46,7 +46,7 @@ class FindMaxHpTargetStrategy : public FindTargetStrategy
|
|||||||
{
|
{
|
||||||
if (Group* group = botAI->GetBot()->GetGroup())
|
if (Group* group = botAI->GetBot()->GetGroup())
|
||||||
{
|
{
|
||||||
ObjectGuid guid = group->GetTargetIcon(4);
|
ObjectGuid guid = group->GetTargetIcons()[4];
|
||||||
if (guid && attacker->GetGUID() == guid)
|
if (guid && attacker->GetGUID() == guid)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ Unit* RtiTargetValue::Calculate()
|
|||||||
if (index == -1)
|
if (index == -1)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
ObjectGuid guid = group->GetTargetIcon(index);
|
ObjectGuid guid = group->GetTargetIcons()[index];
|
||||||
if (!guid)
|
if (!guid)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
|
|||||||
@@ -49,14 +49,14 @@ bool FindNonCcTargetStrategy::IsCcTarget(Unit* attacker)
|
|||||||
int32 index = RtiTargetValue::GetRtiIndex(rti);
|
int32 index = RtiTargetValue::GetRtiIndex(rti);
|
||||||
if (index != -1)
|
if (index != -1)
|
||||||
{
|
{
|
||||||
if (ObjectGuid guid = group->GetTargetIcon(index))
|
if (ObjectGuid guid = group->GetTargetIcons()[index])
|
||||||
if (attacker->GetGUID() == guid)
|
if (attacker->GetGUID() == guid)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ObjectGuid guid = group->GetTargetIcon(4))
|
if (ObjectGuid guid = group->GetTargetIcons()[4])
|
||||||
if (attacker->GetGUID() == guid)
|
if (attacker->GetGUID() == guid)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user