replace ridiculous GetSpawnColors function with something tidier
This commit is contained in:
@@ -121,17 +121,11 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
|||||||
|
|
||||||
public static Dictionary<int2, Color> GetSpawnColors(OrderManager orderManager, Map map)
|
public static Dictionary<int2, Color> GetSpawnColors(OrderManager orderManager, Map map)
|
||||||
{
|
{
|
||||||
var spawns = Map.SpawnPoints;
|
return orderManager.LobbyInfo.Clients
|
||||||
var sc = new Dictionary<int2, Color>();
|
.Where( c => c.SpawnPoint != 0 )
|
||||||
|
.ToDictionary(
|
||||||
for (int i = 1; i <= spawns.Count(); i++)
|
c => Map.SpawnPoints.ElementAt( c.SpawnPoint - 1 ),
|
||||||
{
|
c => c.ColorRamp.GetColor(0));
|
||||||
var client = orderManager.LobbyInfo.Clients.FirstOrDefault(c => c.SpawnPoint == i);
|
|
||||||
if (client == null)
|
|
||||||
continue;
|
|
||||||
sc.Add(spawns.ElementAt(i - 1), client.ColorRamp.GetColor(0));
|
|
||||||
}
|
|
||||||
return sc;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user