Only search for palette definitions on the world actor

This commit is contained in:
abcdefg30
2022-09-14 12:38:15 +02:00
committed by Matthias Mailänder
parent 0bbcff973f
commit 97c96c46f4

View File

@@ -121,9 +121,9 @@ namespace OpenRA.Mods.Common.Lint
void GetPalettes(Ruleset rules, List<string> palettes, List<string> playerPalettes) void GetPalettes(Ruleset rules, List<string> palettes, List<string> playerPalettes)
{ {
foreach (var actorInfo in rules.Actors) // Palettes are only defined on the world actor
{ var worldActorInfo = rules.Actors[SystemActors.World];
foreach (var traitInfo in actorInfo.Value.TraitInfos<TraitInfo>()) foreach (var traitInfo in worldActorInfo.TraitInfos<TraitInfo>())
{ {
var fields = traitInfo.GetType().GetFields(); var fields = traitInfo.GetType().GetFields();
foreach (var field in fields) foreach (var field in fields)
@@ -144,5 +144,4 @@ namespace OpenRA.Mods.Common.Lint
} }
} }
} }
}
} }