Ensure table is mutated before use

This commit is contained in:
Emik 2026-08-16 16:25:54 +02:00
parent 374aa5ec24
commit 88897a77d3
Signed by: emik
GPG key ID: 6B0CD72A5E503BDF
3 changed files with 4 additions and 17 deletions

View file

@ -3,7 +3,7 @@
"id": "Roland", "id": "Roland",
"name": "Roland", "name": "Roland",
"prefix": "Roland", "prefix": "Roland",
"version": "3.0.1", "version": "3.0.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

@ -82,8 +82,6 @@ SMODS.Challenge {
end, end,
} }
local yard_sale
SMODS.Challenge { SMODS.Challenge {
key = "Spring_Cleaning", key = "Spring_Cleaning",
config = {no_interest = true}, config = {no_interest = true},
@ -340,12 +338,14 @@ q {
return false return false
end end
table.insert(Bakery_API.econ_only_items, "j_Roland_yard")
table.insert(Bakery_API.econ_only_items, "j_Roland_artemis")
local orig = Bakery_API.no_money_decks local orig = Bakery_API.no_money_decks
Bakery_API.no_money_decks = setmetatable({}, { Bakery_API.no_money_decks = setmetatable({}, {
orig = orig, orig = orig,
__index = function(_, k) __index = function(_, k)
return (G.GAME or {}).challenge == "c_Roland_Spring_Cleaning" and not yard_sale or orig[k] return (G.GAME or {}).challenge == "c_Roland_Spring_Cleaning" or orig[k]
end, end,
}) })

View file

@ -1371,16 +1371,3 @@ joker {
end end
end, end,
} }
q {
blocking = false,
no_delete = true,
func = function()
if not Bakery_API then
return false
end
table.insert(Bakery_API.econ_only_items, "j_Roland_yard")
table.insert(Bakery_API.econ_only_items, "j_Roland_artemis")
end,
}