diff --git a/OpenRA.Mods.RA/Buildable.cs b/OpenRA.Mods.RA/Buildable.cs index b70b64038f..3d29c40313 100755 --- a/OpenRA.Mods.RA/Buildable.cs +++ b/OpenRA.Mods.RA/Buildable.cs @@ -17,7 +17,7 @@ namespace OpenRA.Mods.RA public readonly string[] Prerequisites = { }; public readonly string[] Owner = { }; - public readonly string Queue; + public readonly string[] Queue = { }; public readonly int BuildLimit = 0; // TODO: UI fluff; doesn't belong here diff --git a/OpenRA.Mods.RA/Player/ClassicProductionQueue.cs b/OpenRA.Mods.RA/Player/ClassicProductionQueue.cs index 5c0a42ba43..10992efe3c 100644 --- a/OpenRA.Mods.RA/Player/ClassicProductionQueue.cs +++ b/OpenRA.Mods.RA/Player/ClassicProductionQueue.cs @@ -105,9 +105,10 @@ namespace OpenRA.Mods.RA if (Info.SpeedUp) { + var queues = unit.Traits.Get().Queue; var selfsameBuildings = self.World.ActorsWithTrait() - .Where(p => p.Trait.Info.Produces.Contains(unit.Traits.Get().Queue)) - .Where(p => p.Actor.Owner == self.Owner).ToArray(); + .Where(p => p.Actor.Owner == self.Owner && p.Trait.Info.Produces.Intersect(queues).Any()) + .ToArray(); var speedModifier = selfsameBuildings.Count().Clamp(1, Info.BuildTimeSpeedReduction.Length) - 1; time = (time * Info.BuildTimeSpeedReduction[speedModifier]) / 100; diff --git a/OpenRA.Mods.RA/Player/PlaceBuilding.cs b/OpenRA.Mods.RA/Player/PlaceBuilding.cs index abd3b176fe..f3a82fa9c5 100644 --- a/OpenRA.Mods.RA/Player/PlaceBuilding.cs +++ b/OpenRA.Mods.RA/Player/PlaceBuilding.cs @@ -106,7 +106,7 @@ namespace OpenRA.Mods.RA var producers = self.World.ActorsWithTrait() .Where(x => x.Actor.Owner == self.Owner - && x.Actor.Info.Traits.Get().Produces.Contains(bi.Queue)) + && x.Actor.Info.Traits.Get().Produces.Intersect(bi.Queue).Any()) .ToList(); var producer = producers.Where(x => x.Actor.IsPrimaryBuilding()).Concat(producers) .FirstOrDefault(); diff --git a/OpenRA.Mods.RA/Player/ProductionQueue.cs b/OpenRA.Mods.RA/Player/ProductionQueue.cs index 8a095f96ee..e1d81e38bc 100644 --- a/OpenRA.Mods.RA/Player/ProductionQueue.cs +++ b/OpenRA.Mods.RA/Player/ProductionQueue.cs @@ -136,9 +136,10 @@ namespace OpenRA.Mods.RA IEnumerable AllBuildables(string category) { return self.World.Map.Rules.Actors.Values - .Where( x => x.Name[ 0 ] != '^' ) - .Where( x => x.Traits.Contains() ) - .Where( x => x.Traits.Get().Queue == category ); + .Where(x => + x.Name[ 0 ] != '^' && + x.Traits.Contains() && + x.Traits.Get().Queue.Contains(category)); } public void OverrideProduction(ActorInfo type, bool buildable) @@ -221,7 +222,7 @@ namespace OpenRA.Mods.RA { var unit = self.World.Map.Rules.Actors[order.TargetString]; var bi = unit.Traits.Get(); - if (bi.Queue != Info.Type) + if (!bi.Queue.Contains(Info.Type)) return; /* Not built by this queue */ var cost = unit.Traits.Contains() ? unit.Traits.Get().Cost : 0; diff --git a/OpenRA.Mods.RA/Scripting/LuaScriptInterface.cs b/OpenRA.Mods.RA/Scripting/LuaScriptInterface.cs index 76bfc98db5..1432ff3adf 100644 --- a/OpenRA.Mods.RA/Scripting/LuaScriptInterface.cs +++ b/OpenRA.Mods.RA/Scripting/LuaScriptInterface.cs @@ -393,7 +393,7 @@ namespace OpenRA.Mods.RA.Scripting if (bi == null) return null; - return GetSharedQueueForCategory(player, bi.Queue); + return bi.Queue.Select(q => GetSharedQueueForCategory(player, q)).FirstOrDefault(); } [LuaGlobal]