From 3b4f515e2aa28341143983848200d827c96185b1 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Wed, 25 Jan 2017 20:07:15 +0000 Subject: [PATCH] Only remove resources when a silo/refinery is killed. --- OpenRA.Mods.Common/Traits/StoresResources.cs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/OpenRA.Mods.Common/Traits/StoresResources.cs b/OpenRA.Mods.Common/Traits/StoresResources.cs index f07a12ec38..0e8fe2ba0b 100644 --- a/OpenRA.Mods.Common/Traits/StoresResources.cs +++ b/OpenRA.Mods.Common/Traits/StoresResources.cs @@ -27,7 +27,7 @@ namespace OpenRA.Mods.Common.Traits public object Create(ActorInitializer init) { return new StoresResources(init.Self, this); } } - class StoresResources : IPips, INotifyOwnerChanged, INotifyCapture, IExplodeModifier, IStoreResources, ISync, INotifyActorDisposing + class StoresResources : IPips, INotifyOwnerChanged, INotifyCapture, IExplodeModifier, IStoreResources, ISync, INotifyKilled { readonly StoresResourcesInfo info; @@ -54,14 +54,9 @@ namespace OpenRA.Mods.Common.Traits newOwner.PlayerActor.Trait().GiveResources(resources); } - bool disposed; - public void Disposing(Actor self) + public void Killed(Actor self, AttackInfo e) { - if (disposed) - return; - player.TakeResources(Stored); // lose the stored resources - disposed = true; } public IEnumerable GetPips(Actor self)