fix invalid target

This commit is contained in:
Yunfan Li
2023-12-17 14:12:41 +08:00
parent 446c3ff5a8
commit 5e6ddce6b2

View File

@@ -5,6 +5,7 @@
#include "InvalidTargetValue.h" #include "InvalidTargetValue.h"
#include "AttackersValue.h" #include "AttackersValue.h"
#include "Playerbots.h" #include "Playerbots.h"
#include "Unit.h"
bool InvalidTargetValue::Calculate() bool InvalidTargetValue::Calculate()
{ {
@@ -16,6 +17,10 @@ bool InvalidTargetValue::Calculate()
if (target && qualifier == "current target") if (target && qualifier == "current target")
{ {
return target->GetMapId() != bot->GetMapId() || return target->GetMapId() != bot->GetMapId() ||
target->HasUnitFlag(UNIT_FLAG_NOT_SELECTABLE) ||
target->HasUnitFlag(UNIT_FLAG_NON_ATTACKABLE) ||
target->HasUnitFlag(UNIT_FLAG_NON_ATTACKABLE_2) ||
!target->IsVisible() ||
!target->IsAlive() || !target->IsAlive() ||
target->IsPolymorphed() || target->IsPolymorphed() ||
target->IsCharmed() || target->IsCharmed() ||