Remove fp from building refund calculation.

This commit is contained in:
Paul Chote
2011-01-02 12:11:38 +13:00
parent f659f55801
commit 38df0a28cd
3 changed files with 11 additions and 8 deletions

View File

@@ -74,7 +74,8 @@ namespace OpenRA.Mods.RA
if (!Info.LocalStorage)
return;
if (--nextProcessTime <= 0) {
if (--nextProcessTime <= 0)
{
// Convert resources to cash
int amount = Math.Min (Ore, Info.ProcessAmount);
amount = Math.Min (amount, PlayerResources.OreCapacity - PlayerResources.Ore);
@@ -82,7 +83,7 @@ namespace OpenRA.Mods.RA
if (amount > 0)
{
Ore -= amount;
PlayerResources.GiveOre (amount);
PlayerResources.GiveOre(amount);
}
nextProcessTime = (PlayerPower.PowerState == PowerState.Normal)?
Info.ProcessTick : Info.LowPowerProcessTick ;
@@ -125,7 +126,7 @@ namespace OpenRA.Mods.RA
if (!Info.LocalStorage)
return null;
return Graphics.Util.MakeArray (Info.PipCount, i => (Ore * 1f / Info.Capacity > i * 1f / Info.PipCount) ? Info.PipColor : PipType.Transparent);
return Graphics.Util.MakeArray (Info.PipCount, i => (Ore * Info.PipCount > i * Info.Capacity) ? Info.PipColor : PipType.Transparent);
}
public bool ShouldExplode(Actor self) { return Ore > 0; }