Skip to content

Commit

Permalink
fix barrymod crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Dregu committed Feb 4, 2024
1 parent ec886d2 commit c8d54ba
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions examples/barrymod.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ register_option_callback('buttons', nil, function(ctx)
if ctx:win_button('Quick Load') then load_state(1) end
end)

function save_early()
return options.save_early and state.theme ~= THEME.OLMEC --typical olmec crashing stuff again
end

set_callback(function()
if not options.save_early then
if not save_early() then
save_state(1)
end
for _, p in pairs(players) do
Expand All @@ -26,7 +30,7 @@ set_callback(function()
end, ON.LEVEL)

set_callback(function()
if options.save_early then
if save_early() then
-- for whatever prng related reason, loading a save created at this point will reroll the level rng, which is a neat I guess
save_state(1)
end
Expand Down

0 comments on commit c8d54ba

Please sign in to comment.