The original method worked better; take the best of both worlds

This commit is contained in:
Paul Chote
2010-06-13 14:09:05 +12:00
parent 640ac9b8e6
commit aba5c777db
6 changed files with 73 additions and 25 deletions

View File

@@ -67,11 +67,11 @@ namespace OpenRA.Mods.Cnc
// Convert resources to cash
var pr = self.Owner.PlayerActor.traits.Get<PlayerResources>();
int amount = Math.Min(Tiberium, Info.ProcessAmount);
amount = Math.Min(amount, pr.CashCapacity - pr.Cash);
amount = Math.Min(amount, pr.OreCapacity - pr.Ore);
if (amount > 0)
{
Tiberium -=amount;
pr.GiveCash(amount);
pr.GiveOre(amount);
}
nextProcessTime = Info.ProcessTick;
}