Fix a typo in ChronosphereProperties class name.

This commit is contained in:
Paul Chote
2018-08-12 21:14:30 +01:00
parent 1977e64e07
commit 828106cf82
2 changed files with 8 additions and 7 deletions

View File

@@ -17,9 +17,9 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Cnc.Scripting
{
[ScriptPropertyGroup("Support Powers")]
public class ChronsphereProperties : ScriptActorProperties, Requires<ChronoshiftPowerInfo>
public class ChronosphereProperties : ScriptActorProperties, Requires<ChronoshiftPowerInfo>
{
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.")]

View File

@@ -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<ChronoshiftableInfo>, 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<ChronoshiftReturnInit>())
@@ -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