Code cleanup.

This commit is contained in:
Matthias Mailänder
2022-02-12 17:50:49 +01:00
committed by teinarss
parent 7735107deb
commit ee95d2591f
5 changed files with 6 additions and 7 deletions

View File

@@ -22,7 +22,7 @@ namespace OpenRA.Network
static Player FindPlayerByClient(this World world, Session.Client c)
{
return world.Players.FirstOrDefault(p => (p.ClientIndex == c.Index && p.PlayerReference.Playable));
return world.Players.FirstOrDefault(p => p.ClientIndex == c.Index && p.PlayerReference.Playable);
}
internal static void ProcessOrder(OrderManager orderManager, World world, int clientId, Order order)
@@ -63,7 +63,7 @@ namespace OpenRA.Network
// ExtraData 0 means this is a normal chat order, everything else is team chat
if (order.ExtraData == 0)
{
var p = world != null ? world.FindPlayerByClient(client) : null;
var p = world?.FindPlayerByClient(client);
var suffix = (p != null && p.WinState == WinState.Lost) ? " (Dead)" : "";
suffix = client.IsObserver ? " (Spectator)" : suffix;