diff --git a/OpenRA.Mods.Common/Traits/Buildings/RepairsUnits.cs b/OpenRA.Mods.Common/Traits/Buildings/RepairsUnits.cs index 22e11c83b3..e95588a24e 100644 --- a/OpenRA.Mods.Common/Traits/Buildings/RepairsUnits.cs +++ b/OpenRA.Mods.Common/Traits/Buildings/RepairsUnits.cs @@ -9,11 +9,9 @@ */ #endregion -using OpenRA.Traits; - namespace OpenRA.Mods.Common.Traits { - public class RepairsUnitsInfo : TraitInfo + public class RepairsUnitsInfo : PausableConditionalTraitInfo { [Desc("Cost in % of the unit value to fully repair the unit.")] public readonly int ValuePercentage = 20; @@ -30,7 +28,12 @@ namespace OpenRA.Mods.Common.Traits [Desc("Experience gained by the player owning this actor for repairing an allied unit.")] public readonly int PlayerExperience = 0; + + public override object Create(ActorInitializer init) { return new RepairsUnits(this); } } - public class RepairsUnits { } + public class RepairsUnits : PausableConditionalTrait + { + public RepairsUnits(RepairsUnitsInfo info) : base(info) { } + } } diff --git a/OpenRA.Mods.Common/Traits/Repairable.cs b/OpenRA.Mods.Common/Traits/Repairable.cs index dfc21e040d..7ada78a98c 100644 --- a/OpenRA.Mods.Common/Traits/Repairable.cs +++ b/OpenRA.Mods.Common/Traits/Repairable.cs @@ -105,7 +105,7 @@ namespace OpenRA.Mods.Common.Traits void AfterReachActivities(Actor self, Order order, IMove movement) { - if (!order.TargetActor.IsInWorld || order.TargetActor.IsDead || order.TargetActor.IsDisabled()) + if (!order.TargetActor.IsInWorld || order.TargetActor.IsDead || order.TargetActor.TraitsImplementing().All(r => r.IsTraitDisabled)) return; // TODO: This is hacky, but almost every single component affected diff --git a/mods/ts/rules/gdi-structures.yaml b/mods/ts/rules/gdi-structures.yaml index aae21a2731..082b8fc440 100644 --- a/mods/ts/rules/gdi-structures.yaml +++ b/mods/ts/rules/gdi-structures.yaml @@ -211,6 +211,7 @@ GAHPAD: PrimaryCondition: primary Reservable: RepairsUnits: + PauseOnCondition: empdisable PlayerExperience: 15 ProductionBar: WithIdleOverlay@PLATFORM: @@ -258,6 +259,7 @@ GADEPT: MaxHeightDelta: 3 Reservable: RepairsUnits: + PauseOnCondition: empdisable PlayerExperience: 15 RallyPoint: Palette: mouse diff --git a/mods/ts/rules/nod-structures.yaml b/mods/ts/rules/nod-structures.yaml index 510f300875..afd1cb6ab6 100644 --- a/mods/ts/rules/nod-structures.yaml +++ b/mods/ts/rules/nod-structures.yaml @@ -222,6 +222,7 @@ NAHPAD: PrimaryCondition: primary Reservable: RepairsUnits: + PauseOnCondition: empdisable PlayerExperience: 15 ProductionBar: WithIdleOverlay@PLATFORM: