From 0ba1fdcea3a57e02bea5f3b46d1db20313226f08 Mon Sep 17 00:00:00 2001 From: atlimit8 Date: Fri, 25 Jul 2014 17:16:54 -0500 Subject: [PATCH] Allow actors that are not buildings to be sold. The more humane way to refund units (as opposed the grinding them). --- OpenRA.Mods.RA/Sellable.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.RA/Sellable.cs b/OpenRA.Mods.RA/Sellable.cs index 77a04c7b2e..e6e8a66b03 100644 --- a/OpenRA.Mods.RA/Sellable.cs +++ b/OpenRA.Mods.RA/Sellable.cs @@ -31,7 +31,8 @@ namespace OpenRA.Mods.RA public void Sell(Actor self) { - if (!self.Trait().Lock()) + var building = self.TraitOrDefault(); + if (building != null && !building.Lock()) return; self.CancelActivity();