1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2024-11-30 06:45:43 +00:00
Aquaria/files/scripts/compat/internal/removenewfunctions.lua

47 lines
1 KiB
Lua
Raw Normal View History

-- Remove all functions that didn't exist in v1.1
-- The known-good list of old script functions
local oldfuncs = dofile("scripts/compat/internal/funclist_1.1.lua")
-- Ignore any standard Lua function known to exist in _G
local luafuncs51 =
{
assert = true,
collectgarbage = true,
dofile = true,
error = true,
getfenv = true,
getmetatable = true,
ipairs = true,
load = true,
loadfile = true,
loadstring = true,
next = true,
pairs = true,
pcall = true,
print = true,
rawequal = true,
rawget = true,
rawset = true,
select = true,
setfenv = true,
setmetatable = true,
tonumber = true,
tostring = true,
type = true,
unpack = true,
xpcall = true,
newproxy = true,
}
for k, f in pairs(_G) do
if type(k) == "string"
and type(f) == "function"
and not luafuncs51[k]
and not oldfuncs[k]
then
debugLog("Compatibility: Remove new script function " .. k)
_G[k] = nil
end
end