mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
[Attack Target] Invalid target check
This commit is contained in:
@@ -469,14 +469,16 @@ bool PossibleAddsTrigger::IsActive()
|
||||
|
||||
bool NotDpsTargetActiveTrigger::IsActive()
|
||||
{
|
||||
Unit* dps = AI_VALUE(Unit*, "dps target");
|
||||
Unit* target = AI_VALUE(Unit*, "current target");
|
||||
Unit* enemy = AI_VALUE(Unit*, "enemy player target");
|
||||
|
||||
// do not switch if enemy target
|
||||
if (target && target == enemy && target->IsAlive())
|
||||
return false;
|
||||
if (target && target->IsAlive()) {
|
||||
|
||||
Unit* enemy = AI_VALUE(Unit*, "enemy player target");
|
||||
if (target == enemy)
|
||||
return false;
|
||||
}
|
||||
|
||||
Unit* dps = AI_VALUE(Unit*, "dps target");
|
||||
return dps && target != dps;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ bool InvalidTargetValue::Calculate()
|
||||
target->isFeared() ||
|
||||
target->HasUnitState(UNIT_STATE_ISOLATED) ||
|
||||
target->IsFriendlyTo(bot) ||
|
||||
!AttackersValue::IsValidTarget(target, bot) ||
|
||||
// !bot->IsWithinDistInMap(target, sPlayerbotAIConfig->sightDistance) ||
|
||||
!bot->IsWithinLOSInMap(target);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user