fixes for arena I've been working on with Dave (most credit belongs to him I feel)

This commit is contained in:
Fuzz
2024-07-04 14:08:21 +10:00
parent 6dddab7c1a
commit 08cbe2f4ec
3 changed files with 40 additions and 9 deletions

View File

@@ -2607,6 +2607,13 @@ bool BGTactics::Execute(Event event)
if (bg->GetStatus() == STATUS_WAIT_LEAVE)
return false;
if (bg->isArena())
{
// can't use this in arena - it will crash server wehen vPaths/vFlagIds are used uninitialized
botAI->ResetStrategies();
return false;
}
if (bg->GetStatus() == STATUS_IN_PROGRESS)
botAI->ChangeStrategy("-buff", BOT_STATE_NON_COMBAT);
@@ -4866,11 +4873,12 @@ bool ArenaTactics::Execute(Event event)
if (botAI->HasStrategy("buff", BOT_STATE_NON_COMBAT))
botAI->ChangeStrategy("-buff", BOT_STATE_NON_COMBAT);
if (sBattlegroundMgr->IsArenaType(bg->GetBgTypeID()))
{
botAI->ResetStrategies(false);
botAI->SetMaster(nullptr);
}
// this causes bot to reset constantly in arena
// if (sBattlegroundMgr->IsArenaType(bg->GetBgTypeID()))
// {
// botAI->ResetStrategies(false);
// botAI->SetMaster(nullptr);
// }
if (!bot->IsInCombat())
return moveToCenter(bg);