From c861e19f2e1dbab197f9fa99be21f2416fd18ff9 Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 5 Mar 2018 23:03:33 +0300 Subject: [PATCH] fix: show the error if can't find the executable file (mod:dofile) --- .../scripts/mods/vmf/modules/core/core_functions.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vmf_source/scripts/mods/vmf/modules/core/core_functions.lua b/vmf_source/scripts/mods/vmf/modules/core/core_functions.lua index bbc342d..9bc1d31 100644 --- a/vmf_source/scripts/mods/vmf/modules/core/core_functions.lua +++ b/vmf_source/scripts/mods/vmf/modules/core/core_functions.lua @@ -158,9 +158,13 @@ VMFMod.dofile = function (self, script_path) local success, values = pack_pcall(pcall(dofile, script_path)) if not success then - self:error("(loadfile): %s", values[1].error) - print("\nTRACEBACK:\n\n" .. tostring(values[1].traceback) .. "\nLOCALS:\n\n" .. tostring(values[1].locals)) + if values[1].error then + self:error("(dofile): %s", values[1].error) + print("\nTRACEBACK:\n\n" .. values[1].traceback .. "\nLOCALS:\n\n" .. values[1].locals) + else + self:error("(dofile): %s", tostring(values[1])) + end end return unpack(values)