From f2494a20110f5a73e960c0266ef1773cc88d89de Mon Sep 17 00:00:00 2001 From: Emik Date: Wed, 17 Jun 2026 13:39:41 +0200 Subject: [PATCH] Fix charms being injected in the wrong order --- manifest.json | 2 +- src/charm.lua | 45 ++++++++++++++++++++++++--------------------- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/manifest.json b/manifest.json index 810f741..913b50e 100644 --- a/manifest.json +++ b/manifest.json @@ -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", diff --git a/src/charm.lua b/src/charm.lua index 83cb811..2fa4149 100644 --- a/src/charm.lua +++ b/src/charm.lua @@ -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)()