Avoid importing spawn points with the same location.

This commit is contained in:
Matthias Mailänder
2016-06-25 09:41:57 +02:00
parent a421a191b5
commit a55b8659c7
2 changed files with 14 additions and 2 deletions

View File

@@ -255,8 +255,8 @@ namespace OpenRA.Mods.Common.UtilityCommands
.Select(kv => Pair.New(Exts.ParseIntegerInvariant(kv.Key),
LocationFromMapOffset(Exts.ParseIntegerInvariant(kv.Value), MapSize)));
// Add waypoint actors
foreach (var kv in wps)
// Add waypoint actors skipping duplicate entries
foreach (var kv in wps.DistinctBy(location => location.Second))
{
if (!singlePlayer && kv.First <= 7)
{