From: ShadowNinja Date: Sun, 22 Dec 2013 22:16:31 +0000 (-0500) Subject: Allow changing screwdriver mode when pointing at a protected node X-Git-Tag: 0.4.9~2 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=5dcc5cb30564b539207bc1007d3e8fb392edfa76;p=oweals%2Fminetest_game.git Allow changing screwdriver mode when pointing at a protected node --- diff --git a/mods/screwdriver/init.lua b/mods/screwdriver/init.lua index 74547ae8..6f99aa57 100644 --- a/mods/screwdriver/init.lua +++ b/mods/screwdriver/init.lua @@ -60,16 +60,16 @@ local function screwdriver_handler(itemstack, user, pointed_thing) return end local pos = pointed_thing.under - if minetest.is_protected(pos, user:get_player_name()) then - minetest.record_protection_violation(pos, user:get_player_name()) - return - end local keys = user:get_player_control() local player_name = user:get_player_name() local mode = tonumber(itemstack:get_metadata()) if not mode or keys["sneak"] == true then return screwdriver_setmode(user, itemstack) end + if minetest.is_protected(pos, user:get_player_name()) then + minetest.record_protection_violation(pos, user:get_player_name()) + return + end local node = minetest.get_node(pos) local node_name = node.name local ndef = minetest.registered_nodes[node.name]