Building capture eva + wtf on silo capture

This commit is contained in:
Paul Chote
2010-07-23 22:28:46 +12:00
parent 31cb2081c6
commit 52c8c93b30
9 changed files with 20 additions and 12 deletions

View File

@@ -23,9 +23,9 @@ namespace OpenRA.Mods.RA
class StoresOre : IPips, INotifyCapture, INotifyDamage, IExplodeModifier, IStoreOre
{
readonly PlayerResources Player;
readonly StoresOreInfo Info;
PlayerResources Player;
public StoresOre(Actor self, StoresOreInfo info)
{
Player = self.Owner.PlayerActor.traits.Get<PlayerResources>();
@@ -34,10 +34,11 @@ namespace OpenRA.Mods.RA
public int Capacity { get { return Info.Capacity; } }
public void OnCapture(Actor self, Actor captor)
public void OnCapture(Actor self, Actor captor, Player oldOwner, Player newOwner)
{
var ore = Stored(self);
Player.TakeOre(ore);
Player = newOwner.PlayerActor.traits.Get<PlayerResources>();
Player.GiveOre(ore);
}