added mod:dofile()

This commit is contained in:
Azumgi 2018-01-24 18:46:13 +03:00
parent 4cc3a49153
commit c574b03bdd

View file

@ -62,6 +62,18 @@ VMFMod.pcall = function (self, ...)
end end
VMFMod.dofile = function (self, script_path)
local status, value = pcall(dofile, script_path)
if not status then
self:echo("ERROR(loadfile): " .. value.error, true)
print("\nTRACEBACK:\n\n" .. value.traceback .. "\nLOCALS:\n\n" .. value.locals)
end
return value
end
-- #################################################################################################################### -- ####################################################################################################################
-- ##### Event functions ############################################################################################## -- ##### Event functions ##############################################################################################
-- #################################################################################################################### -- ####################################################################################################################