From 451b2994fe7278215bed75191f3cb6e0adad0dbd Mon Sep 17 00:00:00 2001 From: mckaygerhard Date: Fri, 26 Apr 2024 17:33:24 -0400 Subject: [PATCH] mod - firefly - fix wrong check for object on place --- mods/fireflies/init.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mods/fireflies/init.lua b/mods/fireflies/init.lua index f5058a8..b0bba83 100644 --- a/mods/fireflies/init.lua +++ b/mods/fireflies/init.lua @@ -47,6 +47,7 @@ minetest.register_tool("fireflies:bug_net", { minetest.is_protected(pointed_thing.under, player:get_player_name()) then return end + if not player then return itemstack end local node_name = minetest.get_node(pointed_thing.under).name local inv = player:get_inventory() if minetest.get_item_group(node_name, "catchable") == 1 then @@ -102,6 +103,8 @@ minetest.register_node("fireflies:firefly_bottle", { }, sounds = default.node_sound_glass_defaults(), 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} if minetest.is_protected(pos, player:get_player_name()) or minetest.get_node(lower_pos).name ~= "air" then