Steamopollys / Steamodded

A Balatro ModLoader
GNU General Public License v3.0
188 stars 42 forks source link

Crash related to the discover/Unlock update #167

Closed ChromaPIE closed 1 month ago

ChromaPIE commented 1 month ago

Crash log: https://mclo.gs/6de7DAX

Culprit in main.lua:

    function SMODS.GameObject:inject_class()
        local o = nil
        for i, key in ipairs(self.obj_buffer) do
            o = self.obj_table[key]
            boot_print_stage(('Injecting %s: %s'):format(o.set, o.key))
            o.atlas = o.atlas or o.set

            if o._discovered_unlocked_overwritten then
                assert(o._saved_d_u) -- L3975 mentioned in the crash report
                o.discovered, o.unlocked = o._d, o._u
                o._discovered_unlocked_overwritten = false
            else
                SMODS._save_d_u(o)
            end

            -- Add centers to pools
            o:inject(i)

            -- Setup Localize text
            o:process_loc_text()

            sendInfoMessage(
                ('Injected game object %s of type %s')
                :format(o.key, o.set), o.set or 'GameObject'
            )
        end
    end
english5040 commented 1 month ago

Pretty unclear what's going on given that there are so many mods in that list, unfortunately. something to look at among those mods would be any that involve init_item_prototypes