Improve spawnpoint lint

This commit is contained in:
Gustas
2023-04-29 13:48:04 +03:00
committed by Matthias Mailänder
parent f344ccb714
commit b5ef9c29cf

View File

@@ -92,8 +92,9 @@ namespace OpenRA.Mods.Common.Lint
if (playerCount > spawnPoints.Length)
emitError($"The map allows {playerCount} possible players, but defines only {spawnPoints.Length} spawn points.");
if (spawnPoints.Distinct().Count() != spawnPoints.Length)
emitError("Duplicate spawn point locations detected.");
foreach (var spawn in spawnPoints.GroupBy(x => x))
if (spawn.Count() > 1)
emitError($"Duplicate spawn point location detected at `{spawn.Key}`.");
}
}
}