repair cost is always at least 1 per tick

This commit is contained in:
Chris Forbes
2012-09-23 17:37:35 +12:00
parent 79b4765d9f
commit cd1a29f1ea

View File

@@ -74,7 +74,7 @@ namespace OpenRA.Mods.RA.Buildings
var buildingValue = self.GetSellValue();
var hpToRepair = Math.Min(Info.RepairStep, Health.MaxHP - Health.HP);
var cost = (hpToRepair * Info.RepairPercent * buildingValue) / (Health.MaxHP * 100);
var cost = Math.Max(1, (hpToRepair * Info.RepairPercent * buildingValue) / (Health.MaxHP * 100));
if (!Repairer.PlayerActor.Trait<PlayerResources>().TakeCash(cost))
{
remainingTicks = 1;