Skip to content

Rerolling the boss crashes occasionally #1443

Description

@LimitlessSocks

Full crash log: https://gist.github.com/LimitlessSocks/468e237951829a656717b734fd1a0b52

Oops! The game crashed:
functions/common_events.lua:2757: attempt to perform arithmetic on a nil value

Additional Context:
Balatro Version: 1.0.1o-FULL
Modded Version: 1.0.0~BETA-1827b-STEAMODDED
Optional features enabled
LÖVE Version: 11.5.0
Lovely Version: 0.9.0
Platform: Windows
Steamodded Mods:
    1: DebugPlus by WilsontheWolf [ID: DebugPlus, Version: 1.5.3~dev, Uses Lovely]
Lovely Mods:

Seemingly introduced by e318298 (custom small/big blinds), the line in question is G.GAME.bosses_used[boss] = G.GAME.bosses_used[boss] + 1 in the get_new_boss function, which chokes on the new G.GAME.bossed_used.{small,big,boss} blind structure. This line also exists in lovely/weights.toml:

G.GAME.bosses_used[ret_boss] = G.GAME.bosses_used[ret_boss] + 1

However, this patch does not seem necessary anymore:

if SMODS.optional_features.object_weights then
ret_boss = SMODS.poll_object({type = 'Blind', blind_type = blind_type, seed = blind_type or 'boss'})
else
ret_boss = pseudorandom_element(SMODS.create_blind_pool(blind_type), pseudoseed(blind_type or 'boss'))
end
SMODS.add_boss_to_used_table(ret_boss, blind_type or 'boss')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions