Skip to content

Commit e63d5c7

Browse files
committed
Fix the lua script not printing any errors if executing a file fails.
1 parent 9d81b13 commit e63d5c7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lua.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ if cmd=="--file" or cmd=="-f" then
88
if f==nil then
99
qerror(err)
1010
end
11-
dfhack.pcall(f,table.unpack(args,3))
11+
dfhack.safecall(f,table.unpack(args,3))
1212
elseif cmd=="--save" or cmd=="-s" then
1313
if df.global.world.cur_savegame.save_dir=="" then
1414
qerror("Savefile not loaded")
@@ -19,7 +19,7 @@ elseif cmd=="--save" or cmd=="-s" then
1919
if f==nil then
2020
qerror(err)
2121
end
22-
dfhack.pcall(f,table.unpack(args,3))
22+
dfhack.safecall(f,table.unpack(args,3))
2323
elseif cmd~=nil then
2424
-- Support some of the prefixes allowed by dfhack.interpreter
2525
local prefix

0 commit comments

Comments
 (0)