Fix bad uses of FirstEnabledTraitOrDefault on TraitInfos.

These are not traits so this method does not work. We can use EnabledByDefault on the ConditionalTraitInfo instead.
This commit is contained in:
RoosterDragon
2017-12-07 21:00:50 +00:00
committed by Paul Chote
parent 7a7eed4fb7
commit 5338784e45
3 changed files with 5 additions and 5 deletions

View File

@@ -26,7 +26,7 @@ namespace OpenRA.Mods.Common.Lint
if (buildable == null)
continue;
var tooltip = actorInfo.Value.TraitInfos<TooltipInfo>().FirstEnabledTraitOrDefault();
var tooltip = actorInfo.Value.TraitInfos<TooltipInfo>().FirstOrDefault(info => info.EnabledByDefault);
if (tooltip == null)
emitError("The following buildable actor has no (enabled) Tooltip: " + actorInfo.Key);
}