Disable team chat when only one team member is alive

This commit is contained in:
abcdefg30
2019-04-14 13:56:48 +02:00
committed by Paul Chote
parent 9a84ccdd1d
commit 83b92ebacb

View File

@@ -93,7 +93,14 @@ namespace OpenRA.Mods.Common.Widgets.Logic
if (world.IsGameOver)
return true;
// Nothing changed since the start
// Check if we are the only living team member
if (players.All(p => p.WinState != WinState.Undefined || !p.IsAlliedWith(world.LocalPlayer)))
{
disableTeamChat = true;
return disableTeamChat;
}
// Still alive and nothing changed since the start
if (world.LocalPlayer.WinState == WinState.Undefined)
return disableTeamChat;