Use pcall because we are paranoid

This commit is contained in:
Emik 2026-02-23 15:49:50 +01:00
parent 55dd6da290
commit 805ff4ab7a
Signed by: emik
GPG key ID: 6B0CD72A5E503BDF
2 changed files with 11 additions and 3 deletions

View file

@ -17,5 +17,5 @@
"conflicts": [
"Jen"
],
"version": "1.5.29"
"version": "1.5.30"
}

View file

@ -654,7 +654,11 @@ back {
for _, v in pairs(G.P_CENTERS) do
if v.apply and not banned_keys[v.key] and (v.set == "Back" or v.set == "Sleeve") then
v:apply(...)
local status, err = pcall(v.apply, v, ...)
if not status then
sendWarnMessage(v.key .. "'s apply cannot run: " .. err)
end
end
end
end,
@ -676,7 +680,11 @@ back {
alt_calculate = function(_, ...)
for _, v in pairs(G.P_CENTERS) do
if v.calculate and not banned_keys[v.key] and (v.set == "Back" or v.set == "Sleeve") then
v:calculate(...)
local status, err = pcall(v.calculate, v, ...)
if not status then
sendWarnMessage(v.key .. "'s calculate cannot run: " .. err)
end
end
end
end,