From 23d9931f65418619ae450e37539f0414b5a13c4e Mon Sep 17 00:00:00 2001 From: avirar Date: Sun, 28 Sep 2025 08:01:24 +1000 Subject: [PATCH] Resolved crash in BGStatusAction (#1656) * Prevent race condition and server crash * Updated other direct packet handling lines to queue packets instead --- src/strategy/actions/BattleGroundJoinAction.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/strategy/actions/BattleGroundJoinAction.cpp b/src/strategy/actions/BattleGroundJoinAction.cpp index 1877a5f2..fda822ef 100644 --- a/src/strategy/actions/BattleGroundJoinAction.cpp +++ b/src/strategy/actions/BattleGroundJoinAction.cpp @@ -688,7 +688,7 @@ bool BGLeaveAction::Execute(Event event) WorldPacket packet(CMSG_BATTLEFIELD_PORT, 20); packet << type << unk2 << (uint32)_bgTypeId << unk << uint8(0); - bot->GetSession()->HandleBattleFieldPortOpcode(packet); + bot->GetSession()->QueuePacket(new WorldPacket(packet)); if (IsRandomBot) botAI->SetMaster(nullptr); @@ -917,7 +917,7 @@ bool BGStatusAction::Execute(Event event) WorldPacket packet(CMSG_BATTLEFIELD_PORT, 20); packet << type << unk2 << (uint32)_bgTypeId << unk << action; - bot->GetSession()->HandleBattleFieldPortOpcode(packet); + bot->GetSession()->QueuePacket(new WorldPacket(packet)); botAI->ResetStrategies(false); if (!bot->GetBattleground()) @@ -972,7 +972,7 @@ bool BGStatusAction::Execute(Event event) WorldPacket packet(CMSG_BATTLEFIELD_PORT, 20); action = 0; packet << type << unk2 << (uint32)_bgTypeId << unk << action; - bot->GetSession()->HandleBattleFieldPortOpcode(packet); + bot->GetSession()->QueuePacket(new WorldPacket(packet)); botAI->ResetStrategies(!IsRandomBot); botAI->GetAiObjectContext()->GetValue("bg type")->Set(0); @@ -1039,7 +1039,7 @@ bool BGStatusAction::Execute(Event event) WorldPacket packet(CMSG_BATTLEFIELD_PORT, 20); packet << type << unk2 << (uint32)_bgTypeId << unk << action; - bot->GetSession()->HandleBattleFieldPortOpcode(packet); + bot->GetSession()->QueuePacket(new WorldPacket(packet)); botAI->ResetStrategies(false); if (!bot->GetBattleground())