diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoStatsLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoStatsLogic.cs index 2bebdb5108..2cba17939c 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoStatsLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoStatsLogic.cs @@ -11,6 +11,7 @@ using System.Drawing; using System.Linq; using OpenRA.Mods.Common.Traits; +using OpenRA.Traits; using OpenRA.Widgets; namespace OpenRA.Mods.Common.Widgets.Logic @@ -53,9 +54,17 @@ namespace OpenRA.Mods.Common.Widgets.Logic nameLabel.GetColor = () => pp.Color.RGB; var flag = item.Get("FACTIONFLAG"); - flag.GetImageName = () => pp.Country.Race; flag.GetImageCollection = () => "flags"; - item.Get("FACTION").GetText = () => pp.Country.Name; + if (lp.Stances[pp] == Stance.Ally || lp.WinState != WinState.Undefined) + { + flag.GetImageName = () => pp.Country.Race; + item.Get("FACTION").GetText = () => pp.Country.Name; + } + else + { + flag.GetImageName = () => pp.PlayerReference.Race; + item.Get("FACTION").GetText = () => pp.PlayerReference.Race; + } var team = item.Get("TEAM"); var teamNumber = (client == null) ? 0 : client.Team; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs index 163987b45d..b1e8720728 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs @@ -464,8 +464,11 @@ namespace OpenRA.Mods.Common.Widgets.Logic public static void AddPlayerFlagAndName(ScrollItemWidget template, Player player) { var flag = template.Get("FLAG"); - flag.GetImageName = () => player.Country.Race; flag.GetImageCollection = () => "flags"; + if (player.World.RenderPlayer != null && player.World.RenderPlayer.Stances[player] != Stance.Ally) + flag.GetImageName = () => player.PlayerReference.Race; + else + flag.GetImageName = () => player.Country.Race; var playerName = template.Get("PLAYER"); var client = player.World.LobbyInfo.ClientWithIndex(player.ClientIndex);