1
0
зеркало из https://github.com/Uberi/Minetest-WorldEdit.git synced 2025-09-16 10:55:33 +02:00
Этот коммит содержится в:
Imre Péntek
2024-03-28 17:02:13 +01:00
родитель a6f68ed4e7
Коммит d4ca3db924

Просмотреть файл

@@ -4,6 +4,9 @@
--- Executes `code` as a Lua chunk in the global namespace.
-- @return An error message if the code fails, or nil on success.
function worldedit.lua(code, name)
if string.sub(code,1,1)=="=" then
code="return "..string.sub(code,2)
end
local factory, err = loadstring("return function(p) " .. code .. " end")
if not factory then -- Syntax error
return false, err