resources moved off player onto a synced trait

This commit is contained in:
Chris Forbes
2010-05-12 18:29:25 +12:00
parent a4592e7019
commit 46e465cf33
24 changed files with 186 additions and 152 deletions

View File

@@ -38,7 +38,7 @@ namespace OpenRA.Mods.RA
collector.World.AddFrameEndTask(w =>
{
var amount = (info as GiveCashCrateActionInfo).Amount;
collector.Owner.GiveCash(amount);
collector.Owner.PlayerActor.traits.Get<PlayerResources>().GiveCash(amount);
});
base.Activate(collector);
}

View File

@@ -56,7 +56,7 @@ namespace OpenRA.Mods.RA
public void Deliver(Actor self, Actor proc)
{
proc.Owner.GiveOre(contents.Sum(kv => kv.Key.ValuePerUnit * kv.Value));
proc.Owner.PlayerActor.traits.Get<PlayerResources>().GiveOre(contents.Sum(kv => kv.Key.ValuePerUnit * kv.Value));
contents.Clear();
}

View File

@@ -37,7 +37,7 @@ namespace OpenRA.Mods.RA
public bool Disabled
{
get { return (self.Owner.GetPowerState() != PowerState.Normal); }
get { return (self.Owner.PlayerActor.traits.Get<PlayerResources>().GetPowerState() != PowerState.Normal); }
set {} // Cannot explicity set
}
}