X

Civilization 6 Choose Production bug

2022/6/14

Bug Description:

Production List panel disappear when Click choose Production button.

Probably your mod caused the bug.

Screenshot 2022-06-14 012028.png

Lua.log

Runtime Error: Sid Meier's Civilization 6\Base\Assets\UI\Panels\ProductionPanel.lua:1387: attempt to index a nil value
stack traceback:
    Sid Meier's Civilization 6\Base\Assets\UI\Panels\ProductionPanel.lua:1387: in function 'PopulateUnits'
    Sid Meier's Civilization 6\Base\Assets\UI\Panels\ProductionPanel.lua:1581: in function 'PopulateList'
    Sid Meier's Civilization 6\Base\Assets\UI\Panels\ProductionPanel.lua:660: in function 'View'
    Sid Meier's Civilization 6\Base\Assets\UI\Panels\ProductionPanel.lua:1866: in function 'Refresh'
    Sid Meier's Civilization 6\Base\Assets\UI\Panels\ProductionPanel.lua:546: in function 'OnCitySelectionChanged'
    [C]: in function 'func'
    [C]: in function '(anonymous)'

Fix:

Edit the file Sid Meier's Civilization 6\Base\Assets\UI\Panels\ProductionPanel.lua

Search for:

for i, item in ipairs(unitData) do

after

else
unitListing = unitList["unitListIM"]:GetInstance();
end
add these codes:
if item.Corps or item.Army then
    if unitListing.CorpsArmyDropdownArea == nil then
        item.Corps = false
        item.Army = false
    end
end

For me, it's works. Once you finish UNIT_TRAIN_NEED_MILITARY_ACADEMY, you may get the issue. Because your unit not support Corps or Army, so disable them.

Commit