added custom sell value trait. this fixes sell/repair on FACT, and buy/sell exploit on PROC
This commit is contained in:
@@ -15,7 +15,8 @@ namespace OpenRa.Traits.Activities
|
||||
|
||||
void DoSell(Actor self)
|
||||
{
|
||||
var cost = self.Info.Traits.Get<BuildableInfo>().Cost;
|
||||
var csv = self.Info.Traits.GetOrDefault<CustomSellValueInfo>();
|
||||
var cost = csv != null ? csv.Value : self.Info.Traits.Get<BuildableInfo>().Cost;
|
||||
var hp = self.Info.Traits.Get<OwnedActorInfo>().HP;
|
||||
var refund = Rules.General.RefundPercent * self.Health * cost / hp;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user