Skip to content

Commit acccffd

Browse files
committed
Fix another way field factory blocks regular build options.
Units that can be blueprinted were always blocked if they weren't the currently selected blueprint. This applied even if the unit was on the standard list of buildees. For example, trying to add Athena back to the global list of things available for all cons left Support Comm unable to build it until it was blueprinted from a strider hub.
1 parent 19e87fb commit acccffd

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

LuaRules/Gadgets/unit_field_factory.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,16 @@ local factoryDefIDs = {}
9494
local fieldBuildOpts = {}
9595
do
9696
local alreadyAdded = {}
97+
98+
-- FIXME: assumes all constructors have the same buildlists
99+
local buildableDirectly = VFS.Include("gamedata/buildoptions.lua")
100+
for i = 1, #buildableDirectly do
101+
local ud = UnitDefNames[buildableDirectly[i]]
102+
if ud then
103+
alreadyAdded[ud.id] = true
104+
end
105+
end
106+
97107
for i = 1, #factories do
98108
local factoryName = factories[i]
99109
local ud = UnitDefNames[factoryName]

0 commit comments

Comments
 (0)