mirror of
https://github.com/Splizard/minetest-mod-snow.git
synced 2024-12-28 23:40:17 +01:00
make more tables weak
This commit is contained in:
parent
049349360e
commit
b3cdf93212
@ -60,7 +60,7 @@ local function get_ws_value(a, x)
|
|||||||
else
|
else
|
||||||
ws_values[a] = {}
|
ws_values[a] = {}
|
||||||
-- weak table, see https://www.lua.org/pil/17.1.html
|
-- weak table, see https://www.lua.org/pil/17.1.html
|
||||||
setmetatable(ws_values[a], {__mode = "v"})
|
setmetatable(ws_values[a], {__mode = "kv"})
|
||||||
end
|
end
|
||||||
v = do_ws_func(a, x)
|
v = do_ws_func(a, x)
|
||||||
ws_values[a][x] = v
|
ws_values[a][x] = v
|
||||||
@ -68,6 +68,7 @@ local function get_ws_value(a, x)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local plantlike_ids = {}
|
local plantlike_ids = {}
|
||||||
|
setmetatable(plantlike_ids, {__mode = "kv"})
|
||||||
local function is_plantlike(id)
|
local function is_plantlike(id)
|
||||||
if plantlike_ids[id] ~= nil then
|
if plantlike_ids[id] ~= nil then
|
||||||
return plantlike_ids[id]
|
return plantlike_ids[id]
|
||||||
@ -88,6 +89,7 @@ local function is_plantlike(id)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local snowable_ids = {}
|
local snowable_ids = {}
|
||||||
|
setmetatable(snowable_ids, {__mode = "kv"})
|
||||||
local function is_snowable(id)
|
local function is_snowable(id)
|
||||||
if snowable_ids[id] ~= nil then
|
if snowable_ids[id] ~= nil then
|
||||||
return snowable_ids[id]
|
return snowable_ids[id]
|
||||||
|
Loading…
Reference in New Issue
Block a user