From 35c5353b6a28b9dc2a1b6d5b510fee916214ce18 Mon Sep 17 00:00:00 2001 From: Yunfan Li Date: Sat, 7 Sep 2024 15:08:50 +0800 Subject: [PATCH] Fix spell allowing dead target --- src/PlayerbotAI.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/PlayerbotAI.cpp b/src/PlayerbotAI.cpp index 2f1583b4..13561a42 100644 --- a/src/PlayerbotAI.cpp +++ b/src/PlayerbotAI.cpp @@ -315,7 +315,8 @@ void PlayerbotAI::UpdateAI(uint32 elapsed, bool minimal) Spell* currentSpell = bot->GetCurrentSpell(CURRENT_GENERIC_SPELL); if (currentSpell && currentSpell->getState() == SPELL_STATE_PREPARING) { - if (currentSpell->m_targets.GetUnitTarget() && !currentSpell->m_targets.GetUnitTarget()->IsAlive()) + if (currentSpell->m_targets.GetUnitTarget() && !currentSpell->m_targets.GetUnitTarget()->IsAlive() && + currentSpell->GetSpellInfo() && !currentSpell->GetSpellInfo()->IsAllowingDeadTarget()) { bot->InterruptSpell(CURRENT_GENERIC_SPELL); SetNextCheckDelay(sPlayerbotAIConfig->reactDelay);