Skip to content

Commit

Permalink
Only allow rotating nodes that could be dug
Browse files Browse the repository at this point in the history
  • Loading branch information
PilzAdam committed Dec 12, 2014
1 parent 2b7ca68 commit 697b39d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mods/screwdriver/init.lua
Expand Up @@ -32,6 +32,10 @@ local function screwdriver_handler(itemstack, user, pointed_thing, mode)
return
end

if ndef.can_dig and not ndef.can_dig(pos, user) then
return
end

-- Set param2
local n = node.param2
local axisdir = math.floor(n / 4)
Expand Down

1 comment on commit 697b39d

@entuland
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I see the reason for this additional check still in place - this check prevents rotating stuff like filled chests, which can be perfectly done without any problem whatsoever - what are the nodes that can't be dug and shouldn't be rotated?

Please sign in to comment.