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

@@ -21,4 +21,18 @@ namespace OpenRA.Mods.RA.Buildings
}
public class CustomSellValue { }
public static class CustomSellValueExts
{
public static int GetSellValue( this Actor a )
{
var csv = a.Info.Traits.GetOrDefault<CustomSellValueInfo>();
if (csv != null) return csv.Value;
var valued = a.Info.Traits.GetOrDefault<ValuedInfo>();
if (valued != null) return valued.Cost;
return 0;
}
}
}