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,9 +4089,11 @@ 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))
{
if (Spell* spell = pFriend->GetCurrentSpell(CURRENT_GENERIC_SPELL))
{
if (spell->m_spellInfo->Id == SPELL_CAPTURE_BANNER)
{
resetObjective();
startNewPathBegin(vPaths);
@@ -4099,6 +4101,8 @@ bool BGTactics::atFlag(std::vector<BattleBotPath*> const& vPaths, std::vector<ui
}
}
}
}
}
// std::ostringstream out; out << "Found " << closeObjects.size() << " nearby objects";
// bot->Say(out.str(), LANG_UNIVERSAL);