<commit_before>if _mpPatch and _mpPatch.loaded and _mpPatch.isModding then
    local function OnSystemUpdateUI(uiType, screen)
        if not ContextPtr:IsHidden() and uiType == SystemUpdateUIType.RestoreUI and screen == "StagingRoom" then
            _mpPatch.debugPrint("Executing OnPreGameDirty.")
            OnPreGameDirty()
        end
    end
    Events.SystemUpdateUI.Add(OnSystemUpdateUI)
end
<commit_msg>Try to fix the problem.<commit_after>if _mpPatch and _mpPatch.loaded and _mpPatch.isModding then
    Events.SystemUpdateUI.Add(function (uiType, screen)
        if not ContextPtr:IsHidden() and uiType == SystemUpdateUIType.RestoreUI and screen == "StagingRoom" then
            _mpPatch.debugPrint("Executing OnPreGameDirty.")
            OnPreGameDirty()
        end
    end)

    function ValidateCivSelections()
        -- do nothing
    end

    PreGame = _mpPatch.hookTable(PreGame, {GetCivilization = function(...)
        local civ = PreGame._super.GetCivilization(...)
        if civ ~= -1 and not GameInfo.Civilizations[civIndex] then
            return -1
        end
        return civ
    end})
end
{'fraction_non_alphanumeric': 0.08274021352313167, 'fraction_numerical': 0.0017793594306049821, 'mean_word_length': 2.865979381443299, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7051686', 'n_tokens_mistral': 332, 'n_tokens_neox': 326, 'n_words': 83}