fix #772 -- GivesBounty uses Actor.GetSellValue

This commit is contained in:
Chris Forbes
2011-05-11 07:55:07 +12:00
parent 0807f4ca8d
commit 3bbcbf4701
4 changed files with 19 additions and 8 deletions

View File

@@ -52,8 +52,7 @@ namespace OpenRA.Mods.RA.Buildings
if (remainingTicks == 0)
{
var csv = self.Info.Traits.GetOrDefault<CustomSellValueInfo>();
var buildingValue = csv != null ? csv.Value : self.Info.Traits.Get<ValuedInfo>().Cost;
var buildingValue = self.GetSellValue();
var hpToRepair = Math.Min(Info.RepairStep, Health.MaxHP - Health.HP);
var cost = (hpToRepair * Info.RepairPercent * buildingValue) / (Health.MaxHP * 100);