Ignore the types of an exit when the production type is null or empty

This commit is contained in:
abcdefg30
2020-02-25 18:10:31 +01:00
committed by Matthias Mailänder
parent 41657dd291
commit a5bc841355
2 changed files with 3 additions and 3 deletions

View File

@@ -111,7 +111,7 @@ namespace OpenRA.Mods.Common.Activities
if (ShouldLandAtBuilding(self, dest))
{
var exit = dest.FirstExitOrDefault(null);
var exit = dest.FirstExitOrDefault();
var offset = exit != null ? exit.Info.SpawnOffset : WVec.Zero;
if (aircraft.Info.TurnToDock || !aircraft.Info.VTOL)
facing = aircraft.Info.InitialFacing;

View File

@@ -53,7 +53,7 @@ namespace OpenRA.Mods.Common.Traits
.OrderBy(e => e.Info.Priority);
if (string.IsNullOrEmpty(productionType))
return all.FirstOrDefault(e => e.Info.ProductionTypes.Count == 0);
return all.FirstOrDefault();
return all.FirstOrDefault(e => e.Info.ProductionTypes.Count == 0 || e.Info.ProductionTypes.Contains(productionType));
}
@@ -64,7 +64,7 @@ namespace OpenRA.Mods.Common.Traits
.Where(Exts.IsTraitEnabled);
if (string.IsNullOrEmpty(productionType))
return all.Where(e => e.Info.ProductionTypes.Count == 0);
return all;
return all.Where(e => e.Info.ProductionTypes.Count == 0 || e.Info.ProductionTypes.Contains(productionType));
}