Merge pull request #511 from liyunfan1223/fix_spell_corpse

Fix spell allowing dead target
This commit is contained in:
Yunfan Li 2024-09-07 16:15:17 +08:00 committed by GitHub
commit 00268ac19d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -315,7 +315,8 @@ void PlayerbotAI::UpdateAI(uint32 elapsed, bool minimal)
Spell* currentSpell = bot->GetCurrentSpell(CURRENT_GENERIC_SPELL); Spell* currentSpell = bot->GetCurrentSpell(CURRENT_GENERIC_SPELL);
if (currentSpell && currentSpell->getState() == SPELL_STATE_PREPARING) 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); bot->InterruptSpell(CURRENT_GENERIC_SPELL);
SetNextCheckDelay(sPlayerbotAIConfig->reactDelay); SetNextCheckDelay(sPlayerbotAIConfig->reactDelay);