Skip to content

Commit

Permalink
Update blueprints-units.lua
Browse files Browse the repository at this point in the history
Fixed a crash if a unit has an enhancements table but not an intel table.
  • Loading branch information
The-Balthazar authored Sep 30, 2024
1 parent 71439fb commit c00e2ce
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions lua/system/blueprints-units.lua
Original file line number Diff line number Diff line change
Expand Up @@ -395,17 +395,19 @@ local function PostProcessUnit(unit)

-- usual case: find all remaining intel
status.AllIntel = {}
for name, value in pairs(intelBlueprint) do

-- may contain tables, such as `JamRadius`
if type(value) ~= 'table' then
if value == true or value > 0 then
local intel = BlueprintNameToIntel[name]
if intel and not activeIntel[intel] then
if allIntelIsFree then
status.AllIntelMaintenanceFree[intel] = true
else
status.AllIntel[intel] = true
if intelBlueprint then
for name, value in pairs(intelBlueprint) do

-- may contain tables, such as `JamRadius`
if type(value) ~= 'table' then
if value == true or value > 0 then
local intel = BlueprintNameToIntel[name]
if intel and not activeIntel[intel] then
if allIntelIsFree then
status.AllIntelMaintenanceFree[intel] = true
else
status.AllIntel[intel] = true
end
end
end
end
Expand Down

0 comments on commit c00e2ce

Please sign in to comment.