Fix frost nova crash (#1106)

This commit is contained in:
Yunfan Li
2025-03-22 13:59:32 +08:00
committed by GitHub
parent 76830796e9
commit e319334b03

View File

@@ -16,7 +16,10 @@ Value<Unit*>* CastPolymorphAction::GetTargetValue() { return context->GetValue<U
bool CastFrostNovaAction::isUseful() bool CastFrostNovaAction::isUseful()
{ {
Unit* target = AI_VALUE(Unit*, "current target"); Unit* target = AI_VALUE(Unit*, "current target");
if (target && target->ToCreature() && target->ToCreature()->HasMechanicTemplateImmunity(1 << (MECHANIC_FREEZE - 1))) if (!target || !target->IsInWorld())
return false;
if (target->ToCreature() && target->ToCreature()->HasMechanicTemplateImmunity(1 << (MECHANIC_FREEZE - 1)))
return false; return false;
if (target->isFrozen()) if (target->isFrozen())