diff --git a/OpenRA.Mods.Cnc/Scripting/Properties/ChronosphereProperties.cs b/OpenRA.Mods.Cnc/Scripting/Properties/ChronosphereProperties.cs index c36eb56764..7577a8b882 100644 --- a/OpenRA.Mods.Cnc/Scripting/Properties/ChronosphereProperties.cs +++ b/OpenRA.Mods.Cnc/Scripting/Properties/ChronosphereProperties.cs @@ -17,9 +17,9 @@ using OpenRA.Traits; namespace OpenRA.Mods.Cnc.Scripting { [ScriptPropertyGroup("Support Powers")] - public class ChronsphereProperties : ScriptActorProperties, Requires + public class ChronosphereProperties : ScriptActorProperties, Requires { - public ChronsphereProperties(ScriptContext context, Actor self) + public ChronosphereProperties(ScriptContext context, Actor self) : base(context, self) { } [Desc("Chronoshift a group of actors. A duration of 0 will teleport the actors permanently.")] diff --git a/OpenRA.Mods.Cnc/Traits/Chronoshiftable.cs b/OpenRA.Mods.Cnc/Traits/Chronoshiftable.cs index e0fefab194..bf5c20880b 100644 --- a/OpenRA.Mods.Cnc/Traits/Chronoshiftable.cs +++ b/OpenRA.Mods.Cnc/Traits/Chronoshiftable.cs @@ -11,6 +11,7 @@ using System.Drawing; using OpenRA.Mods.Cnc.Activities; +using OpenRA.Mods.Common.Activities; using OpenRA.Mods.Common.Traits; using OpenRA.Primitives; using OpenRA.Traits; @@ -18,7 +19,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Cnc.Traits { [Desc("Can be teleported via Chronoshift power.")] - public class ChronoshiftableInfo : ITraitInfo + public class ChronoshiftableInfo : ConditionalTraitInfo { [Desc("Should the actor die instead of being teleported?")] public readonly bool ExplodeInstead = false; @@ -37,9 +38,9 @@ namespace OpenRA.Mods.Cnc.Traits public object Create(ActorInitializer init) { return new Chronoshiftable(init, this); } } - public class Chronoshiftable : ITick, ISync, ISelectionBar, IDeathActorInitModifier, ITransformActorInitModifier, INotifyCreated + public class Chronoshiftable : ConditionalTrait, ITick, ISync, ISelectionBar, + IDeathActorInitModifier, ITransformActorInitModifier, INotifyCreated { - readonly ChronoshiftableInfo info; readonly Actor self; Actor chronosphere; bool killCargo; @@ -51,8 +52,8 @@ namespace OpenRA.Mods.Cnc.Traits [Sync] public int ReturnTicks = 0; public Chronoshiftable(ActorInitializer init, ChronoshiftableInfo info) + : base(info) { - this.info = info; self = init.Self; if (init.Contains()) @@ -70,7 +71,7 @@ namespace OpenRA.Mods.Cnc.Traits void ITick.Tick(Actor self) { - if (!info.ReturnToOrigin || ReturnTicks <= 0) + if (IsTraitDisabled || !Info.ReturnToOrigin || ReturnTicks <= 0) return; // Return to original location