fix debuff trigger

This commit is contained in:
Yunfan Li
2023-09-05 09:58:21 +08:00
parent 93b32ce398
commit 63048f2405
3 changed files with 16 additions and 3 deletions

View File

@@ -294,5 +294,9 @@ Value<Unit*>* BuffOnMainTankAction::GetTargetValue()
bool CastDebuffSpellAction::isUseful()
{
return CastAuraSpellAction::isUseful() && GetTarget() && (GetTarget()->GetHealth() / AI_VALUE(float, "expected group dps")) >= needLifeTime;
Unit* target = GetTarget();
if (!target || !target->IsAlive() || !target->IsInWorld()) {
return false;
}
return CastAuraSpellAction::isUseful() && (target->GetHealth() / AI_VALUE(float, "expected group dps")) >= needLifeTime;
}