Ignore disabled production traits.

This commit is contained in:
abcdefg30
2018-11-03 14:58:43 +00:00
committed by abcdefg30
parent 4a4415c74b
commit a03abe78af
2 changed files with 4 additions and 3 deletions

View File

@@ -55,7 +55,7 @@ namespace OpenRA.Mods.Common.Traits
if (queue == null)
{
var types = world.Selection.Actors.Where(a => a.IsInWorld && a.World.LocalPlayer == a.Owner)
.SelectMany(a => a.TraitsImplementing<Production>())
.SelectMany(a => a.TraitsImplementing<Production>().Where(p => !p.IsTraitDisabled))
.SelectMany(t => t.Info.Produces);
queue = world.LocalPlayer.PlayerActor.TraitsImplementing<ProductionQueue>()

View File

@@ -45,8 +45,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic.Ingame
var player = world.RenderPlayer ?? world.LocalPlayer;
var facilities = world.ActorsHavingTrait<Production>()
.Where(a => a.Owner == player && !a.Info.HasTraitInfo<BaseBuildingInfo>())
.OrderBy(f => f.Info.TraitInfo<ProductionInfo>().Produces.First())
.Where(a => a.Owner == player && !a.Info.HasTraitInfo<BaseBuildingInfo>()
&& a.TraitsImplementing<Production>().Any(t => !t.IsTraitDisabled))
.OrderBy(f => f.TraitsImplementing<Production>().First(t => !t.IsTraitDisabled).Info.Produces.First())
.ToList();
if (!facilities.Any())