Skip to content

Commit

Permalink
Merge pull request #8166 from Warr1024/fix7020
Browse files Browse the repository at this point in the history
Fix (or workaround?) for 'Falling nodes with node inventory cause crash when unloaded'
  • Loading branch information
Warr1024 authored and sfan5 committed Oct 5, 2019
1 parent 7603215 commit ad96df1
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion builtin/game/falling.lua
Expand Up @@ -22,7 +22,18 @@ core.register_entity(":__builtin:falling_node", {

set_node = function(self, node, meta)
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({
is_visible = true,
textures = {node.name},
Expand Down

0 comments on commit ad96df1

Please sign in to comment.