From 61779bf02a0a5dc6a7ebeb8251d7fa9177d2d7fa Mon Sep 17 00:00:00 2001 From: reaperrr Date: Thu, 20 Oct 2016 21:43:50 +0200 Subject: [PATCH] Make WithSpriteTurret ITick implementation explicit --- .../Traits/Render/WithReloadingSpriteTurret.cs | 2 +- OpenRA.Mods.Common/Traits/Render/WithSpriteTurret.cs | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.Cnc/Traits/Render/WithReloadingSpriteTurret.cs b/OpenRA.Mods.Cnc/Traits/Render/WithReloadingSpriteTurret.cs index 1eae2c31c3..103547a083 100644 --- a/OpenRA.Mods.Cnc/Traits/Render/WithReloadingSpriteTurret.cs +++ b/OpenRA.Mods.Cnc/Traits/Render/WithReloadingSpriteTurret.cs @@ -57,7 +57,7 @@ namespace OpenRA.Mods.Cnc.Traits.Render ammoSuffix = (initialAmmoStage * reloadStages / ammo).ToString(); } - public override void Tick(Actor self) + protected override void Tick(Actor self) { if (Info.AimSequence != null) sequence = Attack.IsAttacking ? Info.AimSequence : Info.Sequence; diff --git a/OpenRA.Mods.Common/Traits/Render/WithSpriteTurret.cs b/OpenRA.Mods.Common/Traits/Render/WithSpriteTurret.cs index d69dea2b9e..17b5603b2b 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithSpriteTurret.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithSpriteTurret.cs @@ -119,7 +119,7 @@ namespace OpenRA.Mods.Common.Traits.Render DefaultAnimation.ReplaceAnim(NormalizeSequence(self, DefaultAnimation.CurrentSequence.Name)); } - public virtual void Tick(Actor self) + protected virtual void Tick(Actor self) { if (Info.AimSequence == null) return; @@ -133,6 +133,12 @@ namespace OpenRA.Mods.Common.Traits.Render DamageStateChanged(self); } + void ITick.Tick(Actor self) + { + // Split into a protected method to allow subclassing + Tick(self); + } + void INotifyBuildComplete.BuildingComplete(Actor self) { buildComplete = true; } void INotifySold.Selling(Actor self) { buildComplete = false; } void INotifySold.Sold(Actor self) { }