Skip to content
Snippets Groups Projects
Commit 62d8261e authored by Tim's avatar Tim Committed by Milan
Browse files

merge upstream commit: Bucket: Allow liquid placed against unknown nodes...

merge upstream commit: Bucket: Allow liquid placed against unknown nodes instead of aborting abnormally
parent 95b2def3
No related branches found
No related tags found
No related merge requests found
...@@ -60,16 +60,10 @@ function bucket.register_liquid(source, flowing, itemname, inventory_image, name ...@@ -60,16 +60,10 @@ function bucket.register_liquid(source, flowing, itemname, inventory_image, name
end end
local node = minetest.get_node_or_nil(pointed_thing.under) local node = minetest.get_node_or_nil(pointed_thing.under)
if not node then local ndef = node and minetest.registered_nodes[node.name]
return
end
local ndef = minetest.registered_nodes[node.name]
if not ndef then
return
end
-- Call on_rightclick if the pointed node defines it -- Call on_rightclick if the pointed node defines it
if ndef.on_rightclick and if ndef and ndef.on_rightclick and
user and not user:get_player_control().sneak then user and not user:get_player_control().sneak then
return ndef.on_rightclick( return ndef.on_rightclick(
pointed_thing.under, pointed_thing.under,
...@@ -80,7 +74,7 @@ function bucket.register_liquid(source, flowing, itemname, inventory_image, name ...@@ -80,7 +74,7 @@ function bucket.register_liquid(source, flowing, itemname, inventory_image, name
local lpos local lpos
-- Check if pointing to a buildable node -- Check if pointing to a buildable node
if ndef.buildable_to then if ndef and ndef.buildable_to then
-- buildable; replace the node -- buildable; replace the node
lpos = pointed_thing.under lpos = pointed_thing.under
else else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment