civfanatics / CQUI_Community-Edition

Civilization 6 mod - UI enhancements, reduce clicks and manage your empire faster!
MIT License
149 stars 28 forks source link

Government window does not display, blocking end of turn. #280

Closed wrightc214 closed 3 years ago

wrightc214 commented 3 years ago

Describe the bug Has occurred during three different games now dating back to March 11. I complete a civic that contains a policy card that replaces an existing card. I have to fill the now vacant slot but something is failing. When clicking the Gov icon, the proper sound effect fires but the window doesn't display. The most recent occurrence happened when I completed the Globalization civic. I had Triangular Trade in play and unlocked Ecommerce. Loading an auto save before the error does not resolve the issue.

To Reproduce IDK. It doesn't happen every time it could, but it does happen eventually in every game (3/3 so far).

Expected behavior The policy screen should be visible.

Screenshots If applicable, add screenshots to help explain your problem.

General informations

Save game and logs I checked the logs after writing the rest of this. Going to post it anyways even though it appears to be the other mod causing issues. Runtime Error: E:\Steam\steamapps\workshop\content\289070\2266952591\GovernmentScreen.lua:1491: attempt to index a nil value stack traceback: E:\Steam\steamapps\workshop\content\289070\2266952591\GovernmentScreen.lua:1491: in function 'EnsureRowContentsFit' E:\Steam\steamapps\workshop\content\289070\2266952591\GovernmentScreen.lua:1460: in function 'RealizeActivePolicyRowSize' E:\Steam\steamapps\workshop\content\289070\2266952591\GovernmentScreen.lua:2637: in function 'OnRowAnimCallback' Lua callstack:

Additional context

the-m4a commented 3 years ago

Indeed is Extended Policy Cards... but doesn't look like it's the fault of the mod? EPC is implemented where the entirety of GovernmentScreen.lua is copied from the Firaxis files and then the mod stuff added, so line 1491 in that mod is the one with SetOffsetX here:

    for _,tSlotData in ipairs(tSlotArray) do
        local inst :table = m_ActiveCardInstanceArray[tSlotData.GC_SlotIndex+1];
        inst.Content:SetOffsetX( nextX );
        nextX = nextX + step;
    end

My guess is that inst object is null, because whatever is supposed to be in m_ActiveCardInstanceArray is not there. I went up and down that code and couldn't find something I suspected as the cause... but it seems likely the fact that you discovered something that then caused that policy to disappear is the reason; which you mostly already knew, but based on the code that is what I figure is happening.

Do you have a save file? If you disable EPC, load the save and then try to continue does it work? (I would not think it should - EDR doesn't appear to do anything with any of the Controls involved with this error!)

wrightc214 commented 3 years ago

Just had it happened. Disabling EPC fixed the issue. Re-enabling EPC made it go back to not working.