Skip to content

Commit

Permalink
Bucket: Prevent crashing when placing liquid against a buildable node…
Browse files Browse the repository at this point in the history
… into an unknown node
  • Loading branch information
t4im authored and paramat committed Jul 7, 2016
1 parent 3d44804 commit fe450b4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions mods/bucket/init.lua
Expand Up @@ -88,10 +88,11 @@ function bucket.register_liquid(source, flowing, itemname, inventory_image, name
-- check if the node above can be replaced
lpos = pointed_thing.above
local node = minetest.get_node_or_nil(lpos)
if not node
or not minetest.registered_nodes[node.name].buildable_to then
local above_ndef = node and minetest.registered_nodes[node.name]

if not above_ndef or not above_ndef.buildable_to then
-- do not remove the bucket with the liquid
return
return itemstack
end
end

Expand Down

0 comments on commit fe450b4

Please sign in to comment.