This commit is contained in:
alzeih
2010-07-21 20:44:58 +12:00
parent 8e2d422054
commit ac27b40f7a

View File

@@ -26,7 +26,7 @@ namespace OpenRA.Network
if (client != null) if (client != null)
{ {
var player = Game.world.players.Values.FirstOrDefault(p => p.Index == client.Index); var player = Game.world.players.Values.FirstOrDefault(p => p.Index == client.Index);
if (player.WinState == WinState.Lost) if (player != null && player.WinState == WinState.Lost)
Game.AddChatLine(client.Color1, client.Name + " (Dead)", order.TargetString); Game.AddChatLine(client.Color1, client.Name + " (Dead)", order.TargetString);
else else
Game.AddChatLine(client.Color1, client.Name, order.TargetString); Game.AddChatLine(client.Color1, client.Name, order.TargetString);
@@ -39,14 +39,16 @@ namespace OpenRA.Network
if (client != null) if (client != null)
{ {
var player = Game.world.players.Values.FirstOrDefault(p => p.Index == client.Index); var player = Game.world.players.Values.FirstOrDefault(p => p.Index == client.Index);
if (player != null)
var isAlly = (world.GameHasStarted) ? {
player != null && Game.world.LocalPlayer != null && player.Stances[Game.world.LocalPlayer] == Stance.Ally : var isAlly = (world.GameHasStarted) ?
client == Game.LocalClient || (client.Team == Game.LocalClient.Team && client.Team != 0); player != null && Game.world.LocalPlayer != null && player.Stances[Game.world.LocalPlayer] == Stance.Ally :
client == Game.LocalClient || (client.Team == Game.LocalClient.Team && client.Team != 0);
if (isAlly && player.WinState != WinState.Lost) if (isAlly && player.WinState != WinState.Lost)
Game.AddChatLine(client.Color1, client.Name + " (Team)", order.TargetString); Game.AddChatLine(client.Color1, client.Name + " (Team)", order.TargetString);
else if (player.WinState == WinState.Lost) }
else if (player != null && player.WinState == WinState.Lost)
Game.AddChatLine(client.Color1, client.Name + " (Dead)", order.TargetString); Game.AddChatLine(client.Color1, client.Name + " (Dead)", order.TargetString);
} }
break; break;