From 864baa22410352b8e7323aa56618df68ea61481f Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Tue, 1 Oct 2013 18:58:56 +0400 Subject: [PATCH] Fix the lua script not printing any errors if executing a file fails. --- scripts/lua.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/lua.lua b/scripts/lua.lua index 9bf6ce793..6c31e67aa 100644 --- a/scripts/lua.lua +++ b/scripts/lua.lua @@ -8,7 +8,7 @@ if cmd=="--file" or cmd=="-f" then if f==nil then qerror(err) end - dfhack.pcall(f,table.unpack(args,3)) + dfhack.safecall(f,table.unpack(args,3)) elseif cmd=="--save" or cmd=="-s" then if df.global.world.cur_savegame.save_dir=="" then qerror("Savefile not loaded") @@ -19,7 +19,7 @@ elseif cmd=="--save" or cmd=="-s" then if f==nil then qerror(err) end - dfhack.pcall(f,table.unpack(args,3)) + dfhack.safecall(f,table.unpack(args,3)) elseif cmd~=nil then -- Support some of the prefixes allowed by dfhack.interpreter local prefix