From 81deb2b00c71a80728636b622b497e2f79956173 Mon Sep 17 00:00:00 2001 From: Mustafa Alperen Seki Date: Thu, 12 Jul 2018 17:48:31 +0300 Subject: [PATCH] Make Multipile GivesBounty traits to work properly --- OpenRA.Mods.Common/Traits/GivesBounty.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.Common/Traits/GivesBounty.cs b/OpenRA.Mods.Common/Traits/GivesBounty.cs index 8e384d9a93..b966d7e486 100644 --- a/OpenRA.Mods.Common/Traits/GivesBounty.cs +++ b/OpenRA.Mods.Common/Traits/GivesBounty.cs @@ -10,6 +10,7 @@ #endregion using System.Collections.Generic; +using System.Linq; using OpenRA.Mods.Common.Effects; using OpenRA.Mods.Common.Warheads; using OpenRA.Traits; @@ -78,8 +79,8 @@ namespace OpenRA.Mods.Common.Traits foreach (var a in cargo.Passengers) { - var givesBounty = a.TraitOrDefault(); - if (givesBounty != null) + var givesBounties = a.TraitsImplementing().Where(gb => !gb.IsTraitDisabled); + foreach (var givesBounty in givesBounties) bounty += givesBounty.GetDisplayedBountyValue(a); }