mod - firefly - fix wrong check for object on place
This commit is contained in:
parent
91b64d2996
commit
6822dfd9c4
@ -45,6 +45,7 @@ minetest.register_tool("fireflies:bug_net", {
|
|||||||
description = "Bug Net",
|
description = "Bug Net",
|
||||||
inventory_image = "fireflies_bugnet.png",
|
inventory_image = "fireflies_bugnet.png",
|
||||||
on_use = function(itemstack, player, pointed_thing)
|
on_use = function(itemstack, player, pointed_thing)
|
||||||
|
if not player then return itemstack end
|
||||||
if not pointed_thing or pointed_thing.type ~= "node" or
|
if not pointed_thing or pointed_thing.type ~= "node" or
|
||||||
minetest.is_protected(pointed_thing.under, player:get_player_name()) then
|
minetest.is_protected(pointed_thing.under, player:get_player_name()) then
|
||||||
return
|
return
|
||||||
@ -104,6 +105,8 @@ minetest.register_node("fireflies:firefly_bottle", {
|
|||||||
},
|
},
|
||||||
sounds = default.node_sound_glass_defaults(),
|
sounds = default.node_sound_glass_defaults(),
|
||||||
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
|
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
|
||||||
|
if not player then return itemstack end
|
||||||
|
|
||||||
local lower_pos = {x = pos.x, y = pos.y + 1, z = pos.z}
|
local lower_pos = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||||
if minetest.is_protected(pos, player:get_player_name()) or
|
if minetest.is_protected(pos, player:get_player_name()) or
|
||||||
minetest.get_node(lower_pos).name ~= "air" then
|
minetest.get_node(lower_pos).name ~= "air" then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user