Fix charms being injected in the wrong order

This commit is contained in:
Emik 2026-06-17 13:39:41 +02:00
parent a294b7f7ea
commit f2494a2011
Signed by: emik
GPG key ID: 6B0CD72A5E503BDF
2 changed files with 25 additions and 22 deletions

View file

@ -3,7 +3,7 @@
"id": "Roland",
"name": "Roland",
"prefix": "Roland",
"version": "2.9.1",
"version": "2.9.2",
"badge_colour": "8BE9FD",
"display_name": "Roland",
"main_file": "src/main.lua",

View file

@ -18,33 +18,36 @@ local charm = (function()
---@param tbl SMODS.Joker|{alerted?: boolean, equip?: fun(self: self, card: Card)}
return function(tbl)
q(function()
local current_mod = SMODS.current_mod
SMODS.current_mod = mod
q {
front = true,
func = function()
local current_mod = SMODS.current_mod
SMODS.current_mod = mod
-- SMODS._save_d_u(charm)
tbl.alerted = true
tbl.unlocked = true
tbl.discovered = true
tbl.pos = {x = x, y = 0}
tbl.atlas = "charm"
x = x + 1
-- SMODS._save_d_u(charm)
tbl.alerted = true
tbl.unlocked = true
tbl.discovered = true
tbl.pos = {x = x, y = 0}
tbl.atlas = "charm"
x = x + 1
local orig_equip = tbl.equip
local orig_equip = tbl.equip
function tbl.equip(...)
play_sound("Roland_phone", 1, 0.5)
function tbl.equip(...)
play_sound("Roland_phone", 1, 0.5)
if orig_equip then
return orig_equip(...)
if orig_equip then
return orig_equip(...)
end
end
end
local charm = Bakery_API.Charm(tbl)
charm:inject()
charm:process_loc_text()
SMODS.current_mod = current_mod
end, true)
local charm = Bakery_API.Charm(tbl)
charm:inject()
charm:process_loc_text()
SMODS.current_mod = current_mod
end,
}
end
end)()