nodecore-cd2025/mods/nc_api/issue7020.lua
Aaron Suen 39dea8a2ae MAJOR: Code quality audit using luacheck.
- Removed lots of unused variables, a few shadowed identifiers.
- Removed a few sections of dead code.
2019-08-31 09:26:53 -04:00

23 lines
743 B
Lua

-- LUALOCALS < ---------------------------------------------------------
local minetest, pairs, setmetatable, type
= minetest, pairs, setmetatable, type
-- LUALOCALS > ---------------------------------------------------------
local bifn = minetest.registered_entities["__builtin:falling_node"]
local falling = {
set_node = function(self, node, meta, ...)
meta = meta or {}
if type(meta) ~= "table" then meta = meta:to_table() end
for _, v1 in pairs(meta.inventory or {}) do
for k2, v2 in pairs(v1) do
if type(v2) == "userdata" then
v1[k2] = v2:to_string()
end
end
end
return bifn.set_node(self, node, meta, ...)
end
}
setmetatable(falling, bifn)
minetest.register_entity(":__builtin:falling_node", falling)