Skip to content

Commit

Permalink
Restrict Chronoshiftable trait to Mobile and Husk actors.
Browse files Browse the repository at this point in the history
  • Loading branch information
pchote authored and reaperrr committed Mar 20, 2021
1 parent f5f06b8 commit 0e270be
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions OpenRA.Mods.Cnc/Traits/Chronoshiftable.cs
Expand Up @@ -36,6 +36,12 @@ public class ChronoshiftableInfo : ConditionalTraitInfo
[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); }
}

Expand Down

0 comments on commit 0e270be

Please sign in to comment.