From d6e0598bd02af367cd94231ee417f9d80dff1071 Mon Sep 17 00:00:00 2001 From: reaperrr Date: Fri, 4 May 2018 11:40:36 +0200 Subject: [PATCH] Fix Locomotor lint check It was missing from the project file (oops...) and missing a check for duplicate Locomotor names. --- OpenRA.Mods.Common/Lint/CheckLocomotorReferences.cs | 5 +++++ OpenRA.Mods.Common/OpenRA.Mods.Common.csproj | 1 + 2 files changed, 6 insertions(+) diff --git a/OpenRA.Mods.Common/Lint/CheckLocomotorReferences.cs b/OpenRA.Mods.Common/Lint/CheckLocomotorReferences.cs index a0b6acc6e1..c5bb298434 100644 --- a/OpenRA.Mods.Common/Lint/CheckLocomotorReferences.cs +++ b/OpenRA.Mods.Common/Lint/CheckLocomotorReferences.cs @@ -22,6 +22,11 @@ namespace OpenRA.Mods.Common.Lint { var worldActor = rules.Actors["world"]; var locomotorInfos = worldActor.TraitInfos().ToArray(); + foreach (var li in locomotorInfos) + foreach (var otherLocomotor in locomotorInfos) + if (li != otherLocomotor && li.Name == otherLocomotor.Name) + emitError("There is more than one Locomotor with name {0}!".F(li.Name)); + foreach (var actorInfo in rules.Actors) { foreach (var traitInfo in actorInfo.Value.TraitInfos()) diff --git a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj index 356d795f6f..b4401276fe 100644 --- a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj +++ b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj @@ -197,6 +197,7 @@ +