mirror of
https://github.com/minetest-mods/mesecons.git
synced 2024-12-26 10:20:19 +01:00
Add tostring, tonumber, string to luacontroller, prohibit 'function'
This commit is contained in:
parent
2b30360da2
commit
59cd72191b
@ -139,7 +139,7 @@ end
|
|||||||
|
|
||||||
local code_prohibited = function(code)
|
local code_prohibited = function(code)
|
||||||
-- Clean code
|
-- Clean code
|
||||||
local prohibited = {"while", "for", "repeat", "until"}
|
local prohibited = {"while", "for", "repeat", "until", "function"}
|
||||||
for _, p in ipairs(prohibited) do
|
for _, p in ipairs(prohibited) do
|
||||||
if string.find(code, p) then
|
if string.find(code, p) then
|
||||||
return "Prohibited command: "..p
|
return "Prohibited command: "..p
|
||||||
@ -188,6 +188,9 @@ local create_environment = function(pos, mem, event)
|
|||||||
interrupt = getinterrupt(pos),
|
interrupt = getinterrupt(pos),
|
||||||
digiline_send = getdigiline_send(pos),
|
digiline_send = getdigiline_send(pos),
|
||||||
mem = mem,
|
mem = mem,
|
||||||
|
tostring = tostring,
|
||||||
|
tonumber = tonumber,
|
||||||
|
string = string,
|
||||||
event = event}
|
event = event}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user