Skip to content

Commit 0e90049

Browse files
Merge pull request #465 from larswijn/crash-avoider
Attempt to avoid lovely crashes
2 parents a8a6dc7 + bba558d commit 0e90049

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lovely/lib_misc.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ assembled_string = assembled_string..(type(subpart) == 'string' and subpart or f
219219
'''
220220
position = "at"
221221
payload = '''
222-
assembled_string = assembled_string..(type(subpart) == 'string' and subpart or Cryptid.pluralize(subpart[1], args.vars) or format_ui_value(args.vars[tonumber(subpart[1])]) or 'ERROR')
222+
assembled_string = assembled_string..(type(subpart) == 'string' and subpart or (Cryptid.pluralize and Cryptid.pluralize(subpart[1], args.vars)) or format_ui_value(args.vars[tonumber(subpart[1])]) or 'ERROR')
223223
'''
224224
match_indent = true
225225

lovely/lib_ui.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ target = '''=[SMODS _ "src/card_draw.lua"]'''
2727
pattern = "if self.sticker and G.shared_stickers[self.sticker] then"
2828
position = "before"
2929
payload = '''
30-
if not Cryptid.shared_gamesets then
30+
if not Cryptid.shared_gamesets and G.ASSET_ATLAS["cry_gameset"] then
3131
Cryptid.shared_gamesets = {
3232
modest = Sprite(0, 0, G.CARD_W, G.CARD_H, G.ASSET_ATLAS["cry_gameset"], {x = 0,y = 0}),
3333
mainline = Sprite(0, 0, G.CARD_W, G.CARD_H, G.ASSET_ATLAS["cry_gameset"], {x = 1,y = 0}),
@@ -59,7 +59,7 @@ match_indent = true
5959
target = '''=[SMODS _ "src/card_draw.lua"]'''
6060
pattern = "if self.debuff then"
6161
position = "at"
62-
payload = "if self.debuff or Cryptid.gameset(self) == 'disabled' or (self.config.center.gameset_config and self.config.center.gameset_config[Cryptid.gameset(self)] and self.config.center.gameset_config[Cryptid.gameset(self)].disabled) or (self.config.center.cry_disabled and not self.gameset_select) then"
62+
payload = "if self.debuff or (Cryptid.gameset and Cryptid.gameset(self) == 'disabled') or (self.config.center.gameset_config and self.config.center.gameset_config[Cryptid.gameset(self)] and self.config.center.gameset_config[Cryptid.gameset(self)].disabled) or (self.config.center.cry_disabled and not self.gameset_select) then"
6363
match_indent = true
6464

6565
# Shine on Oversaturated to make it more noticable

0 commit comments

Comments
 (0)