mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
[Attack target] Fix
This commit is contained in:
@@ -23,24 +23,25 @@ GuidVector AttackersValue::Calculate()
|
||||
if (Group* group = bot->GetGroup())
|
||||
AddAttackersOf(group, targets);
|
||||
|
||||
|
||||
RemoveNonThreating(targets);
|
||||
|
||||
// prioritized target
|
||||
GuidVector prioritizedTargets = AI_VALUE(GuidVector, "prioritized targets");
|
||||
for (ObjectGuid target : prioritizedTargets) {
|
||||
Unit* unit = botAI->GetUnit(target);
|
||||
if (unit) {
|
||||
if (unit && IsValidTarget(unit, bot)) {
|
||||
targets.insert(unit);
|
||||
}
|
||||
}
|
||||
if (Group* group = bot->GetGroup()) {
|
||||
ObjectGuid skullGuid = group->GetTargetIcon(4);
|
||||
Unit* skullTarget = botAI->GetUnit(skullGuid);
|
||||
if (skullTarget) {
|
||||
if (skullTarget && IsValidTarget(skullTarget, bot)) {
|
||||
targets.insert(skullTarget);
|
||||
}
|
||||
}
|
||||
|
||||
RemoveNonThreating(targets);
|
||||
|
||||
for (Unit* unit : targets)
|
||||
result.push_back(unit->GetGUID());
|
||||
|
||||
@@ -130,7 +131,7 @@ bool AttackersValue::hasRealThreat(Unit *attacker)
|
||||
attacker->IsAlive() &&
|
||||
!attacker->IsPolymorphed() &&
|
||||
// !attacker->isInRoots() &&
|
||||
!attacker->IsFriendlyTo(bot) &&
|
||||
!attacker->IsFriendlyTo(bot);
|
||||
(attacker->GetThreatMgr().getCurrentVictim() || dynamic_cast<Player*>(attacker));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user