From 12af8506f8b279d9f0536f50c54143da1701d527 Mon Sep 17 00:00:00 2001 From: Gustas <37534529+PunkPun@users.noreply.github.com> Date: Sun, 7 Aug 2022 12:52:32 +0300 Subject: [PATCH] Fix Rearmable using the wrong interface --- OpenRA.Mods.Common/Traits/Rearmable.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/OpenRA.Mods.Common/Traits/Rearmable.cs b/OpenRA.Mods.Common/Traits/Rearmable.cs index 0116391ebd..e9be175904 100644 --- a/OpenRA.Mods.Common/Traits/Rearmable.cs +++ b/OpenRA.Mods.Common/Traits/Rearmable.cs @@ -28,7 +28,7 @@ namespace OpenRA.Mods.Common.Traits public override object Create(ActorInitializer init) { return new Rearmable(this); } } - public class Rearmable : INotifyCreated, INotifyResupply + public class Rearmable : INotifyCreated, INotifyDockClient { public readonly RearmableInfo Info; @@ -44,17 +44,14 @@ namespace OpenRA.Mods.Common.Traits RearmableAmmoPools = self.TraitsImplementing().Where(p => Info.AmmoPools.Contains(p.Info.Name)).ToArray(); } - void INotifyResupply.BeforeResupply(Actor self, Actor target, ResupplyType types) + void INotifyDockClient.Docked(Actor self, Actor dock) { - if (!types.HasFlag(ResupplyType.Rearm)) - return; - // Reset the ReloadDelay to avoid any issues with early cancellation // from previous reload attempts (explicit order, host building died, etc). foreach (var pool in RearmableAmmoPools) pool.RemainingTicks = pool.Info.ReloadDelay; } - void INotifyResupply.ResupplyTick(Actor self, Actor target, ResupplyType types) { } + void INotifyDockClient.Undocked(Actor self, Actor dock) { } } }