From 8f215a0219dc54b918569d0465880a8d8969671f Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Wed, 27 Jun 2018 18:59:31 +0100 Subject: [PATCH] Persist Chronoshift properties across transform. --- OpenRA.Mods.Cnc/Traits/Chronoshiftable.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.Cnc/Traits/Chronoshiftable.cs b/OpenRA.Mods.Cnc/Traits/Chronoshiftable.cs index 90e9444d00..def78e9ac8 100644 --- a/OpenRA.Mods.Cnc/Traits/Chronoshiftable.cs +++ b/OpenRA.Mods.Cnc/Traits/Chronoshiftable.cs @@ -38,7 +38,7 @@ namespace OpenRA.Mods.Cnc.Traits 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 Actor self; @@ -144,7 +144,7 @@ namespace OpenRA.Mods.Cnc.Traits Color ISelectionBar.GetColor() { return info.TimeBarColor; } bool ISelectionBar.DisplayWhenEmpty { get { return false; } } - public void ModifyDeathActorInit(Actor self, TypeDictionary init) + void ModifyActorInit(TypeDictionary init) { if (!info.ReturnToOrigin || ReturnTicks <= 0) return; @@ -155,6 +155,9 @@ namespace OpenRA.Mods.Cnc.Traits if (chronosphere != self) 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