Skip to content

Fix bosses_used compatibility on save load#1430

Open
mleaf233 wants to merge 1 commit into
Steamodded:mainfrom
mleaf233:fix/bosses-used-save-compat
Open

Fix bosses_used compatibility on save load#1430
mleaf233 wants to merge 1 commit into
Steamodded:mainfrom
mleaf233:fix/bosses-used-save-compat

Conversation

@mleaf233

@mleaf233 mleaf233 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Additional Info:

  • I didn't modify api's
  • I didn't modify api's
  • I didn't make new lovely files

This restores compatibility for G.GAME.bosses_used after loading saves.

Custom Small/Big Blinds changed bosses_used from a flat table into a typed table:

  {
    boss = {},
    small = {},
    big = {},
  }

New runs get a metatable that preserves old flat-key access like:

G.GAME.bosses_used["bl_wall"]

However, save serialization does not preserve metatables. After loading a save, old mods that access
G.GAME.bosses_used["bl_*"] receive nil, even when the value exists under G.GAME.bosses_used.boss.

This patch normalizes loaded bosses_used tables and restores the compatibility metatable after Game:start_run loads
save data. keeps the new typed structure while preserving the old flat access pattern used by existing mods built against
vanilla Balatro / earlier SMODS behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant