From 57ba90fe71e830e5e632d4961e53e25fd6fe829d Mon Sep 17 00:00:00 2001 From: michael Date: Sat, 3 Oct 2026 06:13:50 -0400 Subject: [PATCH] fix: sandbox strips standard io, use Mods.lua.io (DMF engine backup); pcall the load-time dump --- AutoMark/scripts/mods/AutoMark/utils/utils.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/AutoMark/scripts/mods/AutoMark/utils/utils.lua b/AutoMark/scripts/mods/AutoMark/utils/utils.lua index 92f3874..a9b7cf7 100644 --- a/AutoMark/scripts/mods/AutoMark/utils/utils.lua +++ b/AutoMark/scripts/mods/AutoMark/utils/utils.lua @@ -77,8 +77,9 @@ function mod:dump_breeds() table.concat(tags, ",")) end + -- the mod sandbox strips the standard io library, go through DMF's engine backup local path = "./../mods/AutoMark/breed_dump.txt" - local file, err = io.open(path, "w") + local file, err = Mods.lua.io.open(path, "w") if file then file:write(table.concat(lines, "\n")) file:close() @@ -88,4 +89,8 @@ function mod:dump_breeds() end end -mod:dump_breeds() +-- never let the dev dump break mod load +local ok, err = pcall(mod.dump_breeds, mod) +if not ok then + mod:echo("breed dump error:", tostring(err)) +end