From 83b92ebacb3d6a5485aba37a9ac2041e21c1f03f Mon Sep 17 00:00:00 2001 From: abcdefg30 Date: Sun, 14 Apr 2019 13:56:48 +0200 Subject: [PATCH] Disable team chat when only one team member is alive --- .../Widgets/Logic/Ingame/IngameChatLogic.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameChatLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameChatLogic.cs index c50d493b53..ec3f346550 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameChatLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameChatLogic.cs @@ -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;