mirror of
https://github.com/minetest/minetest.git
synced 2024-11-23 08:03:45 +01:00
Merge pull request #8166 from Warr1024/fix7020
Fix (or workaround?) for 'Falling nodes with node inventory cause crash when unloaded'
This commit is contained in:
parent
76032159bd
commit
ad96df191b
@ -22,7 +22,18 @@ core.register_entity(":__builtin:falling_node", {
|
|||||||
|
|
||||||
set_node = function(self, node, meta)
|
set_node = function(self, node, meta)
|
||||||
self.node = node
|
self.node = node
|
||||||
self.meta = meta or {}
|
meta = meta or {}
|
||||||
|
if type(meta.to_table) == "function" then
|
||||||
|
meta = meta:to_table()
|
||||||
|
end
|
||||||
|
for _, list in pairs(meta.inventory or {}) do
|
||||||
|
for i, stack in pairs(list) do
|
||||||
|
if type(stack) == "userdata" then
|
||||||
|
list[i] = stack:to_string()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
self.meta = meta
|
||||||
self.object:set_properties({
|
self.object:set_properties({
|
||||||
is_visible = true,
|
is_visible = true,
|
||||||
textures = {node.name},
|
textures = {node.name},
|
||||||
|
Loading…
Reference in New Issue
Block a user