Hunter crash fix

This commit is contained in:
Yunfan Li
2024-04-18 21:07:13 +08:00
parent 6dc6667920
commit 0629c106ae

View File

@@ -41,7 +41,7 @@ bool CastAutoShotAction::isUseful()
if (botAI->IsInVehicle() && !botAI->IsInVehicle(false, false, true))
return false;
if (bot->GetCurrentSpell(CURRENT_AUTOREPEAT_SPELL) && bot->GetCurrentSpell(CURRENT_AUTOREPEAT_SPELL)->m_targets.GetUnitTargetGUID() == AI_VALUE(Unit*, "current target")->GetGUID()) {
if (AI_VALUE(Unit*, "current target") && bot->GetCurrentSpell(CURRENT_AUTOREPEAT_SPELL) && bot->GetCurrentSpell(CURRENT_AUTOREPEAT_SPELL)->m_targets.GetUnitTargetGUID() == AI_VALUE(Unit*, "current target")->GetGUID()) {
return false;
}
return AI_VALUE(uint32, "active spell") != AI_VALUE2(uint32, "spell id", getName());