Core/Battlegrounds: Avoid increasing player count per team when re-logging if player was already in the BG (#27266)

(cherry picked from commit 6c512113d3)
This commit is contained in:
Gildor
2021-11-16 11:46:07 +01:00
committed by Shauren
parent d6ec0afc78
commit 1b56e13e87

View File

@@ -1046,10 +1046,12 @@ void Battleground::AddPlayer(Player* player)
bp.Team = team;
bp.ActiveSpec = player->GetPrimarySpecialization();
bool const isInBattleground = IsPlayerInBattleground(player->GetGUID());
// Add to list/maps
m_Players[player->GetGUID()] = bp;
UpdatePlayersCountByTeam(team, false); // +1 player
if (!isInBattleground)
UpdatePlayersCountByTeam(team, false); // +1 player
WorldPackets::Battleground::BattlegroundPlayerJoined playerJoined;
playerJoined.Guid = player->GetGUID();