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 a9b3e4435f
Signed by: emik
GPG key ID: 6B0CD72A5E503BDF
2 changed files with 25 additions and 22 deletions

View file

@ -3,7 +3,7 @@
"id": "Roland", "id": "Roland",
"name": "Roland", "name": "Roland",
"prefix": "Roland", "prefix": "Roland",
"version": "2.9.1", "version": "2.9.2",
"badge_colour": "8BE9FD", "badge_colour": "8BE9FD",
"display_name": "Roland", "display_name": "Roland",
"main_file": "src/main.lua", "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)} ---@param tbl SMODS.Joker|{alerted?: boolean, equip?: fun(self: self, card: Card)}
return function(tbl) return function(tbl)
q(function() q {
local current_mod = SMODS.current_mod front = true,
SMODS.current_mod = mod func = function()
local current_mod = SMODS.current_mod
SMODS.current_mod = mod
-- SMODS._save_d_u(charm) -- SMODS._save_d_u(charm)
tbl.alerted = true tbl.alerted = true
tbl.unlocked = true tbl.unlocked = true
tbl.discovered = true tbl.discovered = true
tbl.pos = {x = x, y = 0} tbl.pos = {x = x, y = 0}
tbl.atlas = "charm" tbl.atlas = "charm"
x = x + 1 x = x + 1
local orig_equip = tbl.equip local orig_equip = tbl.equip
function tbl.equip(...) function tbl.equip(...)
play_sound("Roland_phone", 1, 0.5) play_sound("Roland_phone", 1, 0.5)
if orig_equip then if orig_equip then
return orig_equip(...) return orig_equip(...)
end
end end
end
local charm = Bakery_API.Charm(tbl) local charm = Bakery_API.Charm(tbl)
charm:inject() charm:inject()
charm:process_loc_text() charm:process_loc_text()
SMODS.current_mod = current_mod SMODS.current_mod = current_mod
end, true) end,
}
end end
end)() end)()