forked from minetest/minetest_game
Bucket: Prevent crashing when placing liquid against a buildable node into an unknown node
This commit is contained in:
parent
3d44804074
commit
fe450b4144
@ -88,10 +88,11 @@ function bucket.register_liquid(source, flowing, itemname, inventory_image, name
|
|||||||
-- check if the node above can be replaced
|
-- check if the node above can be replaced
|
||||||
lpos = pointed_thing.above
|
lpos = pointed_thing.above
|
||||||
local node = minetest.get_node_or_nil(lpos)
|
local node = minetest.get_node_or_nil(lpos)
|
||||||
if not node
|
local above_ndef = node and minetest.registered_nodes[node.name]
|
||||||
or not minetest.registered_nodes[node.name].buildable_to then
|
|
||||||
|
if not above_ndef or not above_ndef.buildable_to then
|
||||||
-- do not remove the bucket with the liquid
|
-- do not remove the bucket with the liquid
|
||||||
return
|
return itemstack
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user