use local function safe_run

This commit is contained in:
Zemtzov7 2023-07-02 20:21:04 +05:00 committed by GitHub
parent 8ffee54ecd
commit 0ce05330ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,7 +12,7 @@ local modlist = core.get_modnames() or {"Failed to load modlist"}
local worldpath = core.get_worldpath()
local F = core.formspec_escape
function safe_run(code)
local function safe_run(code)
local func, err = loadstring(code)
if not func then -- Syntax error
return err