mirror of
https://github.com/notwa/mm
synced 2024-11-05 05:39:02 -08:00
Connor Olding
1acbaba58c
theres still a lot of work to do\nsince most scripts just set globals explicitly\nthis is still better than implied globals though
20 lines
446 B
Lua
20 lines
446 B
Lua
local mt = getmetatable(_G)
|
|
if mt == nil then
|
|
mt = {}
|
|
setmetatable(_G, mt)
|
|
end
|
|
|
|
function mt.__newindex(t, n, v)
|
|
if n == '_TEMP_BIZHAWK_RULES_' then
|
|
rawset(t, n, v)
|
|
return
|
|
end
|
|
error("cannot assign undeclared global '" .. tostring(n) .. "'", 2)
|
|
end
|
|
|
|
function mt.__index(t, n)
|
|
if n == '_TEMP_BIZHAWK_RULES_' then
|
|
return
|
|
end
|
|
error("cannot use undeclared global '" .. tostring(n) .. "'", 2)
|
|
end
|