From 0e270bec5640fbc4048bc249fff20dcd4bad184f Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sun, 14 Mar 2021 17:24:17 +0000 Subject: [PATCH] Restrict Chronoshiftable trait to Mobile and Husk actors. --- OpenRA.Mods.Cnc/Traits/Chronoshiftable.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/OpenRA.Mods.Cnc/Traits/Chronoshiftable.cs b/OpenRA.Mods.Cnc/Traits/Chronoshiftable.cs index c35214aa95..e591580612 100644 --- a/OpenRA.Mods.Cnc/Traits/Chronoshiftable.cs +++ b/OpenRA.Mods.Cnc/Traits/Chronoshiftable.cs @@ -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() && !ai.HasTraitInfo()) + throw new YamlException("Chronoshiftable requires actors to have the Mobile or Husk traits."); + } + public override object Create(ActorInitializer init) { return new Chronoshiftable(init, this); } }