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

This commit is contained in:
Gildor
2023-01-20 17:33:21 +01:00
committed by GitHub
parent 835e291831
commit aeb4d18e20

View File

@@ -1097,8 +1097,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()));
}