Skip to content

Commit

Permalink
Allow changing screwdriver mode when pointing at a protected node
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadowNinja committed Dec 22, 2013
1 parent 4ea001f commit 5dcc5cb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mods/screwdriver/init.lua
Expand Up @@ -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]
Expand Down

0 comments on commit 5dcc5cb

Please sign in to comment.