diff --git a/OpenRA.Mods.RA/CashTrickler.cs b/OpenRA.Mods.RA/CashTrickler.cs index 6fe37b7..1235446 100644 --- a/OpenRA.Mods.RA/CashTrickler.cs +++ b/OpenRA.Mods.RA/CashTrickler.cs @@ -8,6 +8,7 @@ */ #endregion +using System.Linq; using OpenRA.Traits; using OpenRA.Mods.RA.Effects; @@ -20,6 +21,7 @@ namespace OpenRA.Mods.RA public readonly bool ShowTicks = true; public readonly int TickLifetime = 30; public readonly int TickVelocity = 1; + public readonly bool RequiresPower = false; public object Create (ActorInitializer init) { return new CashTrickler(this); } } @@ -36,6 +38,10 @@ namespace OpenRA.Mods.RA public void Tick(Actor self) { + // Check if powered: no trickling if disabled + if (Info.RequiresPower && self.TraitsImplementing().Any(d => d.Disabled)) + return; + if (--ticks < 0) { self.Owner.PlayerActor.Trait().GiveCash(Info.Amount);