fix crash wrt chat in lobby
This commit is contained in:
@@ -23,7 +23,7 @@ namespace OpenRA.Network
|
|||||||
|
|
||||||
public Client ClientWithIndex( int clientID )
|
public Client ClientWithIndex( int clientID )
|
||||||
{
|
{
|
||||||
return Clients.Single( c => c.Index == clientID );
|
return Clients.SingleOrDefault( c => c.Index == clientID );
|
||||||
}
|
}
|
||||||
|
|
||||||
public Client ClientInSlot( Slot slot )
|
public Client ClientInSlot( Slot slot )
|
||||||
|
|||||||
@@ -36,14 +36,10 @@ namespace OpenRA.Network
|
|||||||
case "Chat":
|
case "Chat":
|
||||||
{
|
{
|
||||||
var client = orderManager.LobbyInfo.ClientWithIndex( clientId );
|
var client = orderManager.LobbyInfo.ClientWithIndex( clientId );
|
||||||
if (client != null)
|
if( client != null )
|
||||||
{
|
Game.AddChatLine( client.Color1, client.Name, order.TargetString );
|
||||||
var player = world.FindPlayerByClientId(clientId);
|
else
|
||||||
if (player != null && player.WinState == WinState.Lost)
|
Game.AddChatLine( Color.White, "(player {0})".F( clientId ), order.TargetString );
|
||||||
Game.AddChatLine(client.Color1, client.Name + " (Dead)", order.TargetString);
|
|
||||||
else
|
|
||||||
Game.AddChatLine(client.Color1, client.Name, order.TargetString);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "TeamChat":
|
case "TeamChat":
|
||||||
|
|||||||
Reference in New Issue
Block a user