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

@@ -23,9 +23,8 @@ namespace OpenRA.Mods.RA.Activities
var h = self.TraitOrDefault<Health>();
var si = self.Info.Traits.Get<SellableInfo>();
var pr = self.Owner.PlayerActor.Trait<PlayerResources>();
var csv = self.Info.Traits.GetOrDefault<CustomSellValueInfo>();
var cost = csv != null ? csv.Value : self.Info.Traits.Get<ValuedInfo>().Cost;
var cost = self.GetSellValue();
var refund = (cost * si.RefundPercent * (h == null ? 1 : h.HP)) / (100 * (h == null ? 1 : h.MaxHP));
pr.GiveCash(refund);