From 342fc5b0e91ba80979baa5db7151c0a66639f118 Mon Sep 17 00:00:00 2001 From: Gustas Date: Sat, 11 Nov 2023 16:43:52 +0200 Subject: [PATCH] Fix trait linting not providing trait and actor names --- OpenRA.Mods.Common/Lint/CheckTranslationReference.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenRA.Mods.Common/Lint/CheckTranslationReference.cs b/OpenRA.Mods.Common/Lint/CheckTranslationReference.cs index cb954911e0..e23f01cfdd 100644 --- a/OpenRA.Mods.Common/Lint/CheckTranslationReference.cs +++ b/OpenRA.Mods.Common/Lint/CheckTranslationReference.cs @@ -35,8 +35,8 @@ namespace OpenRA.Mods.Common.Lint { foreach (var traitInfo in actorInfo.Value.TraitInfos()) { - var fields = Utility.GetFields(traitInfo.GetType()); - foreach (var field in fields) + var traitType = traitInfo.GetType(); + foreach (var field in Utility.GetFields(traitType)) { var translationReference = Utility.GetCustomAttributes(field, true).FirstOrDefault(); if (translationReference == null) @@ -48,7 +48,7 @@ namespace OpenRA.Mods.Common.Lint if (key == null) { if (!translationReference.Optional) - emitError($"Trait `{traitInfo.InstanceName}` on field `{field.Name}` has an empty translation reference."); + emitError($"Actor type `{actorInfo.Key}` has an empty translation reference in trait `{traitType.Name[..^4]}.{field.Name}`."); continue; }