mirror of
https://github.com/minetest-mods/mesecons.git
synced 2025-01-11 17:40:20 +01:00
Use table.copy instead of each separate function
This commit is contained in:
parent
077cdaa2a4
commit
a19ef422ea
@ -475,52 +475,8 @@ local function create_environment(pos, mem, event, itbl, send_warning)
|
|||||||
find = safe_string_find,
|
find = safe_string_find,
|
||||||
split = safe_string_split,
|
split = safe_string_split,
|
||||||
},
|
},
|
||||||
math = {
|
math = table.copy(math),
|
||||||
abs = math.abs,
|
table = table.copy(table),
|
||||||
acos = math.acos,
|
|
||||||
asin = math.asin,
|
|
||||||
atan = math.atan,
|
|
||||||
atan2 = math.atan2,
|
|
||||||
ceil = math.ceil,
|
|
||||||
cos = math.cos,
|
|
||||||
cosh = math.cosh,
|
|
||||||
deg = math.deg,
|
|
||||||
exp = math.exp,
|
|
||||||
factorial = math.factorial,
|
|
||||||
floor = math.floor,
|
|
||||||
fmod = math.fmod,
|
|
||||||
frexp = math.frexp,
|
|
||||||
huge = math.huge,
|
|
||||||
hypot = math.hypot,
|
|
||||||
ldexp = math.ldexp,
|
|
||||||
log = math.log,
|
|
||||||
log10 = math.log10,
|
|
||||||
max = math.max,
|
|
||||||
min = math.min,
|
|
||||||
modf = math.modf,
|
|
||||||
pi = math.pi,
|
|
||||||
pow = math.pow,
|
|
||||||
rad = math.rad,
|
|
||||||
random = math.random,
|
|
||||||
sin = math.sin,
|
|
||||||
sing = math.sign,
|
|
||||||
sinh = math.sinh,
|
|
||||||
sqrt = math.sqrt,
|
|
||||||
tan = math.tan,
|
|
||||||
tanh = math.tanh,
|
|
||||||
},
|
|
||||||
table = {
|
|
||||||
concat = table.concat,
|
|
||||||
copy = table.copy,
|
|
||||||
indexof = table.indexof,
|
|
||||||
insert = table.insert,
|
|
||||||
insert_all = table.insert_all,
|
|
||||||
key_value_swap = table.key_value_swap,
|
|
||||||
maxn = table.maxn,
|
|
||||||
remove = table.remove,
|
|
||||||
shuffle = table.shuffle,
|
|
||||||
sort = table.sort,
|
|
||||||
},
|
|
||||||
os = {
|
os = {
|
||||||
clock = os.clock,
|
clock = os.clock,
|
||||||
difftime = os.difftime,
|
difftime = os.difftime,
|
||||||
@ -530,7 +486,7 @@ local function create_environment(pos, mem, event, itbl, send_warning)
|
|||||||
dump2 = dump2,
|
dump2 = dump2,
|
||||||
dump = dump,
|
dump = dump,
|
||||||
minetest = {
|
minetest = {
|
||||||
wrap_text = minetest.wrap_text,
|
--wrap_text = minetest.wrap_text,
|
||||||
pos_to_string = minetest.pos_to_string,
|
pos_to_string = minetest.pos_to_string,
|
||||||
string_to_pos = minetest.string_to_pos,
|
string_to_pos = minetest.string_to_pos,
|
||||||
string_to_area = minetest.string_to_area,
|
string_to_area = minetest.string_to_area,
|
||||||
@ -544,7 +500,7 @@ local function create_environment(pos, mem, event, itbl, send_warning)
|
|||||||
encode_base64 = minetest.encode_base64,
|
encode_base64 = minetest.encode_base64,
|
||||||
decode_base64 = minetest.decode_base64,
|
decode_base64 = minetest.decode_base64,
|
||||||
},
|
},
|
||||||
vector = vector,
|
vector = table.copy(vector),
|
||||||
}
|
}
|
||||||
env._G = env
|
env._G = env
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user