potential fix for #94 (not 100% sure as can't reproduce)

This commit is contained in:
Fuzz
2024-08-14 23:27:07 +10:00
parent f7d229dde2
commit 780934a9e4

View File

@@ -4089,13 +4089,17 @@ bool BGTactics::atFlag(std::vector<BattleBotPath*> const& vPaths, std::vector<ui
{
for (auto& guid : closePlayers)
{
Unit* pFriend = botAI->GetUnit(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;
}
}
}
}
}