diff --git a/OpenRA.Mods.RA/Traits/Infiltration/InfiltrateForCash.cs b/OpenRA.Mods.RA/Traits/Infiltration/InfiltrateForCash.cs index e033993aac..65237782b2 100644 --- a/OpenRA.Mods.RA/Traits/Infiltration/InfiltrateForCash.cs +++ b/OpenRA.Mods.RA/Traits/Infiltration/InfiltrateForCash.cs @@ -10,6 +10,7 @@ using System; using OpenRA.Mods.Common.Effects; +using OpenRA.Mods.Common.Traits; using OpenRA.Traits; namespace OpenRA.Mods.RA.Traits @@ -34,9 +35,10 @@ namespace OpenRA.Mods.RA.Traits { var targetResources = self.Owner.PlayerActor.Trait(); var spyResources = infiltrator.Owner.PlayerActor.Trait(); + var spyValue = infiltrator.Info.TraitInfoOrDefault(); var toTake = (targetResources.Cash + targetResources.Resources) * info.Percentage / 100; - var toGive = Math.Max(toTake, info.Minimum); + var toGive = Math.Max(toTake, info.Minimum >= 0 ? info.Minimum : spyValue != null ? spyValue.Cost : 0); targetResources.TakeCash(toTake); spyResources.GiveCash(toGive);