Persist Chronoshift properties across transform.
This commit is contained in:
@@ -38,7 +38,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
|||||||
public object Create(ActorInitializer init) { return new Chronoshiftable(init, this); }
|
public object Create(ActorInitializer init) { return new Chronoshiftable(init, this); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Chronoshiftable : ITick, ISync, ISelectionBar, IDeathActorInitModifier, INotifyCreated
|
public class Chronoshiftable : ITick, ISync, ISelectionBar, IDeathActorInitModifier, ITransformActorInitModifier, INotifyCreated
|
||||||
{
|
{
|
||||||
readonly ChronoshiftableInfo info;
|
readonly ChronoshiftableInfo info;
|
||||||
readonly Actor self;
|
readonly Actor self;
|
||||||
@@ -144,7 +144,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
|||||||
Color ISelectionBar.GetColor() { return info.TimeBarColor; }
|
Color ISelectionBar.GetColor() { return info.TimeBarColor; }
|
||||||
bool ISelectionBar.DisplayWhenEmpty { get { return false; } }
|
bool ISelectionBar.DisplayWhenEmpty { get { return false; } }
|
||||||
|
|
||||||
public void ModifyDeathActorInit(Actor self, TypeDictionary init)
|
void ModifyActorInit(TypeDictionary init)
|
||||||
{
|
{
|
||||||
if (!info.ReturnToOrigin || ReturnTicks <= 0)
|
if (!info.ReturnToOrigin || ReturnTicks <= 0)
|
||||||
return;
|
return;
|
||||||
@@ -155,6 +155,9 @@ namespace OpenRA.Mods.Cnc.Traits
|
|||||||
if (chronosphere != self)
|
if (chronosphere != self)
|
||||||
init.Add(new ChronoshiftChronosphereInit(chronosphere));
|
init.Add(new ChronoshiftChronosphereInit(chronosphere));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void IDeathActorInitModifier.ModifyDeathActorInit(Actor self, TypeDictionary init) { ModifyActorInit(init); }
|
||||||
|
void ITransformActorInitModifier.ModifyTransformActorInit(Actor self, TypeDictionary init) { ModifyActorInit(init); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ChronoshiftReturnInit : IActorInit<int>
|
public class ChronoshiftReturnInit : IActorInit<int>
|
||||||
|
|||||||
Reference in New Issue
Block a user