Skip to content

Commit 8021898

Browse files
committed
fix weird tag related crash
1 parent 35df7c8 commit 8021898

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lovely/cat.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ target = "tag.lua"
203203
pattern = '''local tag_sprite = Sprite(0,0,_size*1,_size*1,G.ASSET_ATLAS[(not self.hide_ability) and G.P_TAGS[self.key].atlas or "tags"], (self.hide_ability) and G.tag_undiscovered.pos or self.pos)'''
204204
position = "at"
205205
payload = '''
206-
local tagatlas = G.ASSET_ATLAS[(not self.hide_ability) and G.P_TAGS[self.key].atlas or "tags"]
206+
local tagatlas = G.ASSET_ATLAS[self and (not self.hide_ability) and G.P_TAGS[self.key] and G.P_TAGS[self.key].atlas or "tags"]
207207
if self.ability.shiny and not self.hide_ability then
208208
if G.P_TAGS[self.key].shiny_atlas then
209209
tagatlas = G.ASSET_ATLAS[G.P_TAGS[self.key].shiny_atlas]

lovely/misc.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,8 @@ target = "functions/button_callbacks.lua"
246246
pattern = '''add_tag(_tag.config.ref_table)'''
247247
position = "at"
248248
payload = '''
249-
local tag = Tag(Cryptid.get_next_tag())
250-
add_tag(tag or _tag.config.ref_table, true)
249+
local tag_key = Cryptid.get_next_tag()
250+
add_tag(tag_key and Tag(tag_key) or _tag.config.ref_table, true)
251251
'''
252252
match_indent = true
253253

0 commit comments

Comments
 (0)