Merge pull request #11519 from Mailaender/utility-same-spawn

Avoid importing spawn points with the same location
This commit is contained in:
Oliver Brakmann
2016-07-09 15:08:33 +02:00
committed by GitHub
2 changed files with 14 additions and 2 deletions

View File

@@ -254,8 +254,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)
{