Fix the lua script not printing any errors if executing a file fails.

develop
Alexander Gavrilov 2013-10-01 18:58:56 +04:00
parent e175efa689
commit 864baa2241
1 changed files with 2 additions and 2 deletions

@ -8,7 +8,7 @@ if cmd=="--file" or cmd=="-f" then
if f==nil then if f==nil then
qerror(err) qerror(err)
end end
dfhack.pcall(f,table.unpack(args,3)) dfhack.safecall(f,table.unpack(args,3))
elseif cmd=="--save" or cmd=="-s" then elseif cmd=="--save" or cmd=="-s" then
if df.global.world.cur_savegame.save_dir=="" then if df.global.world.cur_savegame.save_dir=="" then
qerror("Savefile not loaded") qerror("Savefile not loaded")
@ -19,7 +19,7 @@ elseif cmd=="--save" or cmd=="-s" then
if f==nil then if f==nil then
qerror(err) qerror(err)
end end
dfhack.pcall(f,table.unpack(args,3)) dfhack.safecall(f,table.unpack(args,3))
elseif cmd~=nil then elseif cmd~=nil then
-- Support some of the prefixes allowed by dfhack.interpreter -- Support some of the prefixes allowed by dfhack.interpreter
local prefix local prefix