Skip to content

Commit adf04bd

Browse files
authored
avoid crash
1 parent 02e12e6 commit adf04bd

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

lovely/misc.toml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,4 +422,21 @@ if (not self.ability.orbital_hand) or (not G.GAME.hands[self.ability.orbital_han
422422
self.ability.orbital_hand = pseudorandom_element(_poker_hands, pseudoseed('orbital'))
423423
end
424424
'''
425-
match_indent = true
425+
match_indent = true
426+
427+
# avoids a game-locking crash related to opened booster being nil
428+
# remove this as soon as a fix is done
429+
[[patches]]
430+
[patches.pattern]
431+
target = "game.lua"
432+
pattern = "SMODS.OPENED_BOOSTER.config.center:update_pack(dt)"
433+
position = "at"
434+
payload = '''
435+
if not SMODS.OPENED_BOOSTER then
436+
G.STATE = G.STATES.SHOP
437+
print('Error: SMODS.OPENED_BOOSTER is nil. Game recovered by setting game state to shop.')
438+
else
439+
SMODS.OPENED_BOOSTER.config.center:update_pack(dt)
440+
end
441+
'''
442+
match_indent = true

0 commit comments

Comments
 (0)