Core/Battlegrounds: Prevent end Arena when a dead player logout (#28766)

(cherry picked from commit aeb4d18e20)
This commit is contained in:
Gildor
2023-01-20 17:33:21 +01:00
committed by Shauren
parent 0aa153c6fe
commit 0e76b4ab9d

View File

@@ -1218,8 +1218,8 @@ void Battleground::EventPlayerLoggedOut(Player* player)
// drop flag and handle other cleanups
RemovePlayer(player, guid, GetPlayerTeam(guid));
// 1 player is logging out, if it is the last, then end arena!
if (isArena())
// 1 player is logging out, if it is the last alive, then end arena!
if (isArena() && player->IsAlive())
if (GetAlivePlayersCountByTeam(player->GetBGTeam()) <= 1 && GetPlayersCountByTeam(GetOtherTeam(player->GetBGTeam())))
EndBattleground(GetOtherTeam(player->GetBGTeam()));
}