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

This commit is contained in:
Gildor
2021-11-16 11:46:07 +01:00
committed by GitHub
parent e0f1bdcd89
commit 6c512113d3

View File

@@ -991,10 +991,12 @@ void Battleground::AddPlayer(Player* player)
bp.OfflineRemoveTime = 0;
bp.Team = team;
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
WorldPacket data;
sBattlegroundMgr->BuildPlayerJoinedBattlegroundPacket(&data, player);