quick hack around the teamchat crash in lobby

This commit is contained in:
Chris Forbes
2010-10-12 21:19:27 +13:00
parent 6b6c9639f9
commit 7c31f72db6

View File

@@ -47,15 +47,18 @@ namespace OpenRA.Network
var client = orderManager.LobbyInfo.ClientWithIndex(clientId); var client = orderManager.LobbyInfo.ClientWithIndex(clientId);
if (client != null) if (client != null)
{ {
var player = world.FindPlayerByClientId(clientId); if (world != null) // TODO: fix this whole thing properly. this is BS.
var display = player != null
&& (world.LocalPlayer != null && player.Stances[world.LocalPlayer] == Stance.Ally
|| player.WinState == WinState.Lost);
if (display)
{ {
var suffix = (player != null && player.WinState == WinState.Lost) ? " (Dead)" : " (Team)"; var player = world.FindPlayerByClientId(clientId);
Game.AddChatLine(client.Color1, client.Name + suffix, order.TargetString); var display = player != null
&& (world.LocalPlayer != null && player.Stances[world.LocalPlayer] == Stance.Ally
|| player.WinState == WinState.Lost);
if (display)
{
var suffix = (player != null && player.WinState == WinState.Lost) ? " (Dead)" : " (Team)";
Game.AddChatLine(client.Color1, client.Name + suffix, order.TargetString);
}
} }
} }
break; break;