From 780934a9e426e73faccc98397713877ccf37ee7f Mon Sep 17 00:00:00 2001 From: Fuzz Date: Wed, 14 Aug 2024 23:27:07 +1000 Subject: [PATCH] potential fix for #94 (not 100% sure as can't reproduce) --- src/strategy/actions/BattleGroundTactics.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) 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; + } + } } } }