From bc37d001c663bf6b936a5a97ad86f327d561a1c6 Mon Sep 17 00:00:00 2001 From: upsilon Date: Mon, 30 Jan 2017 17:43:19 +0100 Subject: [PATCH] worms on_place: check whether placer is not nil before checking for protection --- worms.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/worms.lua b/worms.lua index a59ee55..f73fbab 100755 --- a/worms.lua +++ b/worms.lua @@ -16,6 +16,9 @@ minetest.register_craftitem("fishing:bait_worm", { groups = { fishing_bait=1 }, inventory_image = "fishing_bait_worm.png", on_place = function(itemstack, placer, pointed_thing) + if not placer then -- can happen, e.g. if placed using minetest.place_node + return itemstack + end local pt = pointed_thing if not minetest.is_protected(pt.under, placer:get_player_name()) then minetest.add_entity({x=pt.under.x, y=pt.under.y+0.6, z=pt.under.z}, "fishing:bait_worm_entity")