mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
[Spell] SpellInfo check on current spell
This commit is contained in:
@@ -317,13 +317,13 @@ void PlayerbotAI::UpdateAI(uint32 elapsed, bool minimal)
|
|||||||
Spell* currentSpell = bot->GetCurrentSpell(CURRENT_GENERIC_SPELL);
|
Spell* currentSpell = bot->GetCurrentSpell(CURRENT_GENERIC_SPELL);
|
||||||
if (!currentSpell)
|
if (!currentSpell)
|
||||||
currentSpell = bot->GetCurrentSpell(CURRENT_CHANNELED_SPELL);
|
currentSpell = bot->GetCurrentSpell(CURRENT_CHANNELED_SPELL);
|
||||||
if (currentSpell && currentSpell->getState() == SPELL_STATE_PREPARING)
|
if (currentSpell && currentSpell->GetSpellInfo() && currentSpell->getState() == SPELL_STATE_PREPARING)
|
||||||
{
|
{
|
||||||
const SpellInfo* spellInfo = currentSpell->GetSpellInfo();
|
const SpellInfo* spellInfo = currentSpell->GetSpellInfo();
|
||||||
|
|
||||||
// interrupt if target is dead
|
// interrupt if target is dead
|
||||||
if (currentSpell->m_targets.GetUnitTarget() && !currentSpell->m_targets.GetUnitTarget()->IsAlive() &&
|
if (currentSpell->m_targets.GetUnitTarget() && !currentSpell->m_targets.GetUnitTarget()->IsAlive() &&
|
||||||
spellInfo && !spellInfo->IsAllowingDeadTarget())
|
!spellInfo->IsAllowingDeadTarget())
|
||||||
{
|
{
|
||||||
InterruptSpell();
|
InterruptSpell();
|
||||||
SetNextCheckDelay(sPlayerbotAIConfig->reactDelay);
|
SetNextCheckDelay(sPlayerbotAIConfig->reactDelay);
|
||||||
|
|||||||
Reference in New Issue
Block a user