Revert "Use metatables to make gGlobalSoundSource readonly"
This reverts commit a905f317a7
.
This commit is contained in:
parent
a905f317a7
commit
87d4902f46
|
@ -306,20 +306,8 @@ end
|
||||||
-- sound --
|
-- sound --
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
local function read_only(t)
|
|
||||||
local proxy = {}
|
|
||||||
local mt = { -- create metatable
|
|
||||||
__index = t,
|
|
||||||
__newindex = function()
|
|
||||||
error('attempt to update a read-only table', 2)
|
|
||||||
end
|
|
||||||
}
|
|
||||||
setmetatable(proxy, mt)
|
|
||||||
return proxy
|
|
||||||
end
|
|
||||||
|
|
||||||
--- @type Vec3f
|
--- @type Vec3f
|
||||||
gGlobalSoundSource = read_only({ x = 0, y = 0, z = 0 })
|
gGlobalSoundSource = { x = 0, y = 0, z = 0 }
|
||||||
|
|
||||||
--- @param bank number
|
--- @param bank number
|
||||||
--- @param soundID number
|
--- @param soundID number
|
||||||
|
|
|
@ -308,20 +308,8 @@ end
|
||||||
-- sound --
|
-- sound --
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
local function read_only(t)
|
|
||||||
local proxy = {}
|
|
||||||
local mt = { -- create metatable
|
|
||||||
__index = t,
|
|
||||||
__newindex = function()
|
|
||||||
error('attempt to update a read-only table', 2)
|
|
||||||
end
|
|
||||||
}
|
|
||||||
setmetatable(proxy, mt)
|
|
||||||
return proxy
|
|
||||||
end
|
|
||||||
|
|
||||||
--- @type Vec3f
|
--- @type Vec3f
|
||||||
gGlobalSoundSource = read_only({ x = 0, y = 0, z = 0 })
|
gGlobalSoundSource = { x = 0, y = 0, z = 0 }
|
||||||
|
|
||||||
--- @param bank number
|
--- @param bank number
|
||||||
--- @param soundID number
|
--- @param soundID number
|
||||||
|
|
|
@ -272,19 +272,8 @@ char gSmluaConstants[] = ""
|
||||||
"-----------\n"
|
"-----------\n"
|
||||||
"-- sound --\n"
|
"-- sound --\n"
|
||||||
"-----------\n"
|
"-----------\n"
|
||||||
"local function read_only(t)\n"
|
|
||||||
" local proxy = {}\n"
|
|
||||||
" local mt = { -- create metatable\n"
|
|
||||||
" __index = t,\n"
|
|
||||||
" __newindex = function()\n"
|
|
||||||
" error('attempt to update a read-only table', 2)\n"
|
|
||||||
" end\n"
|
|
||||||
" }\n"
|
|
||||||
" setmetatable(proxy, mt)\n"
|
|
||||||
" return proxy\n"
|
|
||||||
"end\n"
|
|
||||||
"--- @type Vec3f\n"
|
"--- @type Vec3f\n"
|
||||||
"gGlobalSoundSource = read_only({ x = 0, y = 0, z = 0 })\n"
|
"gGlobalSoundSource = { x = 0, y = 0, z = 0 }\n"
|
||||||
"--- @param bank number\n"
|
"--- @param bank number\n"
|
||||||
"--- @param soundID number\n"
|
"--- @param soundID number\n"
|
||||||
"--- @param priority number\n"
|
"--- @param priority number\n"
|
||||||
|
|
Loading…
Reference in New Issue