From 85b5df108e5f9efdd1b258ad05b7d115eb75ae59 Mon Sep 17 00:00:00 2001 From: mostlikely4r Date: Wed, 9 Oct 2024 15:27:24 +0200 Subject: [PATCH] -Auto bg queue fix: Attempt to stop bots spamming the console when trying to join a bg when in a different bg. --- .../strategy/actions/BattleGroundJoinAction.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/playerbot/strategy/actions/BattleGroundJoinAction.cpp b/playerbot/strategy/actions/BattleGroundJoinAction.cpp index 4b945bb7..497e45b0 100644 --- a/playerbot/strategy/actions/BattleGroundJoinAction.cpp +++ b/playerbot/strategy/actions/BattleGroundJoinAction.cpp @@ -1464,12 +1464,6 @@ bool BGStatusAction::Execute(Event& event) #endif #endif -#ifdef MANGOSBOT_ZERO - sLog.outBasic("Bot #%d <%s> (%u %s) joined BG (%s)", bot->GetGUIDLow(), bot->GetName(), bot->GetLevel(), bot->GetTeam() == ALLIANCE ? "A" : "H", _bgType.c_str()); -#else - sLog.outBasic("Bot #%d %s:%d <%s> joined %s - %s", bot->GetGUIDLow(), bot->GetTeam() == ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), isArena ? "Arena" : "BG", _bgType.c_str()); -#endif - ai->Unmount(); action = 0x1; @@ -1491,10 +1485,19 @@ bool BGStatusAction::Execute(Event& event) leave << uint8(0) << uint8(0) << uint32(0) << uint16(0); bot->GetSession()->HandleLeaveBattlefieldOpcode(leave); //Queue the event again to try to join next tick. - ai->HandleBotOutgoingPacket(event.getPacket()); + //ai->HandleBotOutgoingPacket(event.getPacket()); + sLog.outError("Bot %s leaves to join.", bot->GetName()); return true; } + sLog.outError("Bot %s joins.", bot->GetName()); + +#ifdef MANGOSBOT_ZERO + sLog.outBasic("Bot #%d <%s> (%u %s) joined BG (%s)", bot->GetGUIDLow(), bot->GetName(), bot->GetLevel(), bot->GetTeam() == ALLIANCE ? "A" : "H", _bgType.c_str()); +#else + sLog.outBasic("Bot #%d %s:%d <%s> joined %s - %s", bot->GetGUIDLow(), bot->GetTeam() == ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), isArena ? "Arena" : "BG", _bgType.c_str()); +#endif + bot->GetSession()->HandleBattlefieldPortOpcode(packet); ai->ResetStrategies(false);