This commit is contained in:
Lejo 2024-04-16 16:02:25 +02:00 committed by GitHub
commit 6202fa2094
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -522,50 +522,32 @@ local function create_environment(pos, mem, event, itbl, send_warning)
find = safe_string_find,
split = safe_string_split,
},
math = {
abs = math.abs,
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,
floor = math.floor,
fmod = math.fmod,
frexp = math.frexp,
huge = math.huge,
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,
sinh = math.sinh,
sqrt = math.sqrt,
tan = math.tan,
tanh = math.tanh,
},
table = {
concat = table.concat,
insert = table.insert,
maxn = table.maxn,
remove = table.remove,
sort = table.sort,
},
math = table.copy(math),
table = table.copy(table),
os = {
clock = os.clock,
difftime = os.difftime,
time = os.time,
datetable = safe_date,
},
dump2 = dump2,
dump = dump,
minetest = {
--wrap_text = minetest.wrap_text,
pos_to_string = minetest.pos_to_string,
string_to_pos = minetest.string_to_pos,
string_to_area = minetest.string_to_area,
formspec_escape = minetest.formspec_escape,
is_yes = minetest.is_yes,
is_nan = minetest.is_nan,
get_us_time = minetest.get_us_time,
parse_json = minetest.parse_json,
write_json = minetest.write_json,
rgba = minetest.rgba,
encode_base64 = minetest.encode_base64,
decode_base64 = minetest.decode_base64,
},
vector = table.copy(vector),
}
env._G = env