Make Multipile GivesBounty traits to work properly

This commit is contained in:
Mustafa Alperen Seki
2018-07-12 17:48:31 +03:00
committed by Paul Chote
parent 1ffe87b005
commit 81deb2b00c

View File

@@ -10,6 +10,7 @@
#endregion #endregion
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using OpenRA.Mods.Common.Effects; using OpenRA.Mods.Common.Effects;
using OpenRA.Mods.Common.Warheads; using OpenRA.Mods.Common.Warheads;
using OpenRA.Traits; using OpenRA.Traits;
@@ -78,8 +79,8 @@ namespace OpenRA.Mods.Common.Traits
foreach (var a in cargo.Passengers) foreach (var a in cargo.Passengers)
{ {
var givesBounty = a.TraitOrDefault<GivesBounty>(); var givesBounties = a.TraitsImplementing<GivesBounty>().Where(gb => !gb.IsTraitDisabled);
if (givesBounty != null) foreach (var givesBounty in givesBounties)
bounty += givesBounty.GetDisplayedBountyValue(a); bounty += givesBounty.GetDisplayedBountyValue(a);
} }