Fixed ProductionItem costs calculation.

This commit is contained in:
Andre Mohren
2018-07-26 01:23:18 +02:00
committed by Mustafa Alperen Seki
parent e1b1070bcf
commit a57cfc7d40

View File

@@ -582,7 +582,8 @@ namespace OpenRA.Mods.Common.Traits
return; return;
} }
var costThisFrame = RemainingCost / RemainingTime; var expectedRemainingCost = RemainingTime == 1 ? 0 : TotalCost * RemainingTime / Math.Max(1, TotalTime);
var costThisFrame = RemainingCost - expectedRemainingCost;
if (costThisFrame != 0 && !pr.TakeCash(costThisFrame, true)) if (costThisFrame != 0 && !pr.TakeCash(costThisFrame, true))
return; return;