Restrict Chronoshiftable trait to Mobile and Husk actors.

This commit is contained in:
Paul Chote
2021-03-14 17:24:17 +00:00
committed by reaperrr
parent f5f06b86ad
commit 0e270bec56

View File

@@ -36,6 +36,12 @@ namespace OpenRA.Mods.Cnc.Traits
[Desc("The color the bar of the 'return-to-origin' logic has.")]
public readonly Color TimeBarColor = Color.White;
public override void RulesetLoaded(Ruleset rules, ActorInfo ai)
{
if (!ai.HasTraitInfo<MobileInfo>() && !ai.HasTraitInfo<HuskInfo>())
throw new YamlException("Chronoshiftable requires actors to have the Mobile or Husk traits.");
}
public override object Create(ActorInitializer init) { return new Chronoshiftable(init, this); }
}