From 6a9ac4d03dbd80344b0dc3caa860e2c237310b31 Mon Sep 17 00:00:00 2001 From: Mustafa Alperen Seki Date: Wed, 23 Aug 2023 20:57:01 +0300 Subject: [PATCH] Fix bi checks in Production lua. --- .../Scripting/Properties/ProductionProperties.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.Common/Scripting/Properties/ProductionProperties.cs b/OpenRA.Mods.Common/Scripting/Properties/ProductionProperties.cs index 97ff6ec10c6f..63b42d2ff61b 100644 --- a/OpenRA.Mods.Common/Scripting/Properties/ProductionProperties.cs +++ b/OpenRA.Mods.Common/Scripting/Properties/ProductionProperties.cs @@ -194,12 +194,13 @@ public bool IsProducing(string actorType) BuildableInfo GetBuildableInfo(string actorType, string queue) { var ri = Self.World.Map.Rules.Actors[actorType]; - var bi = BuildableInfo.GetTraitForQueue(ri, queue); + var bi = ri.TraitInfos().FirstOrDefault(); + // Error if there are no Buildable traits, return correct one otherwise. if (bi == null) throw new LuaException($"Actor of type {actorType} cannot be produced"); else - return bi; + return BuildableInfo.GetTraitForQueue(ri, queue); } }