mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-04 22:07:52 +00:00
fix(Core/Battlefield): keep queued players in queue when leaving the zone (#26140)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -74,12 +74,13 @@ Battlefield::~Battlefield()
|
||||
CapturePoints.clear();
|
||||
}
|
||||
|
||||
void Battlefield::RemovePlayerFromTracking(ObjectGuid playerGuid)
|
||||
void Battlefield::RemovePlayerFromTracking(ObjectGuid playerGuid, bool removeFromQueue /*= true*/)
|
||||
{
|
||||
for (uint8 i = 0; i < PVP_TEAMS_COUNT; ++i)
|
||||
{
|
||||
InvitedPlayers[i].erase(playerGuid);
|
||||
PlayersInQueue[i].erase(playerGuid);
|
||||
if (removeFromQueue)
|
||||
PlayersInQueue[i].erase(playerGuid);
|
||||
PlayersWillBeKick[i].erase(playerGuid);
|
||||
Players[i].erase(playerGuid);
|
||||
}
|
||||
@@ -152,7 +153,7 @@ void Battlefield::HandlePlayerLeaveZone(Player* player, uint32 /*zone*/)
|
||||
for (BfCapturePoint* cp : CapturePoints)
|
||||
cp->HandlePlayerLeave(player);
|
||||
|
||||
RemovePlayerFromTracking(player->GetGUID());
|
||||
RemovePlayerFromTracking(player->GetGUID(), /*removeFromQueue=*/false);
|
||||
SendRemoveWorldStates(player);
|
||||
RemovePlayerFromResurrectQueue(player->GetGUID());
|
||||
OnPlayerLeaveZone(player);
|
||||
|
||||
@@ -444,7 +444,7 @@ protected:
|
||||
/// Returns true if the player is already tracked as actively in the war or invited to join it.
|
||||
bool IsPlayerInWarOrInvited(Player* player) const;
|
||||
|
||||
void RemovePlayerFromTracking(ObjectGuid playerGuid);
|
||||
void RemovePlayerFromTracking(ObjectGuid playerGuid, bool removeFromQueue = true);
|
||||
|
||||
// Player-iteration helpers: resolve each GUID to a live Player* and call fn(player).
|
||||
// Using templates avoids std::function overhead and works naturally with lambdas.
|
||||
|
||||
Reference in New Issue
Block a user