[Arena] self bot now leaves finished arena game reliably (may also fix issues with other bot types leaving arena or all bot types leaving BG's but I wasnt able to reproduce any 'bots stay in bg/arena' bugs except self-bots in arena)

This commit is contained in:
Fuzz
2024-08-14 15:54:58 +10:00
parent e77e2a6785
commit 520633b4b9
3 changed files with 66 additions and 66 deletions

View File

@@ -4,6 +4,7 @@
*/
#include "BattleGroundTactics.h"
#include "BattleGroundJoinAction.h"
#include "ArenaTeam.h"
#include "ArenaTeamMgr.h"
@@ -2167,7 +2168,7 @@ bool BGTactics::Execute(Event event)
}
if (bg->GetStatus() == STATUS_WAIT_LEAVE)
return false;
return BGStatusAction::LeaveBG(botAI);
if (bg->isArena())
{
@@ -4537,20 +4538,22 @@ bool ArenaTactics::Execute(Event event)
return false;
}
if (bot->GetBattleground()->GetStatus() != STATUS_IN_PROGRESS)
Battleground* bg = bot->GetBattleground();
if (!bg)
return false;
if (bg->GetStatus() == STATUS_WAIT_LEAVE)
return BGStatusAction::LeaveBG(botAI);
if (bg->GetStatus() != STATUS_IN_PROGRESS)
return false;
if (bot->isDead())
{
return false;
}
if (bot->isMoving())
return false;
Battleground* bg = bot->GetBattleground();
if (!bg)
return false;
// startup phase
if (bg->GetStartDelayTime() > 0)