diff --git a/src/strategy/actions/BattleGroundTactics.cpp b/src/strategy/actions/BattleGroundTactics.cpp index 7041129f..6c1527a6 100644 --- a/src/strategy/actions/BattleGroundTactics.cpp +++ b/src/strategy/actions/BattleGroundTactics.cpp @@ -4089,13 +4089,17 @@ bool BGTactics::atFlag(std::vector const& vPaths, std::vectorGetUnit(guid); - if (pFriend->GetCurrentSpell(CURRENT_GENERIC_SPELL) && - pFriend->GetCurrentSpell(CURRENT_GENERIC_SPELL)->m_spellInfo->Id == SPELL_CAPTURE_BANNER) + if (Unit* pFriend = botAI->GetUnit(guid)) { - resetObjective(); - startNewPathBegin(vPaths); - return false; + if (Spell* spell = pFriend->GetCurrentSpell(CURRENT_GENERIC_SPELL)) + { + if (spell->m_spellInfo->Id == SPELL_CAPTURE_BANNER) + { + resetObjective(); + startNewPathBegin(vPaths); + return false; + } + } } } }