From b5ef9c29cfce3768fff1bb8d2bc2118e860902c6 Mon Sep 17 00:00:00 2001 From: Gustas <37534529+PunkPun@users.noreply.github.com> Date: Sat, 29 Apr 2023 13:48:04 +0300 Subject: [PATCH] Improve spawnpoint lint --- OpenRA.Mods.Common/Lint/CheckPlayers.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.Common/Lint/CheckPlayers.cs b/OpenRA.Mods.Common/Lint/CheckPlayers.cs index 38bf0de4a9..392d62b794 100644 --- a/OpenRA.Mods.Common/Lint/CheckPlayers.cs +++ b/OpenRA.Mods.Common/Lint/CheckPlayers.cs @@ -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}`."); } } }