From 5e6ddce6b28945a032bbe249b58a8e33504c3655 Mon Sep 17 00:00:00 2001 From: Yunfan Li Date: Sun, 17 Dec 2023 14:12:41 +0800 Subject: [PATCH] fix invalid target --- src/strategy/values/InvalidTargetValue.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/strategy/values/InvalidTargetValue.cpp b/src/strategy/values/InvalidTargetValue.cpp index 13c25796..cd2df0f5 100644 --- a/src/strategy/values/InvalidTargetValue.cpp +++ b/src/strategy/values/InvalidTargetValue.cpp @@ -5,6 +5,7 @@ #include "InvalidTargetValue.h" #include "AttackersValue.h" #include "Playerbots.h" +#include "Unit.h" bool InvalidTargetValue::Calculate() { @@ -16,6 +17,10 @@ bool InvalidTargetValue::Calculate() if (target && qualifier == "current target") { 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->IsPolymorphed() || target->IsCharmed() ||