Skip to content
Snippets Groups Projects
Commit 82299b94 authored by Auke Kok's avatar Auke Kok Committed by paramat
Browse files

Verify node type is facedir.

This prevents nodes that are not of the "facedir" paramtype2,
as these are generally not expected to be able to rotate. Mods
and other methods may still manipulate param2 of these nodes
as expected.

Addresses #712
parent b1e2ece6
No related branches found
No related tags found
No related merge requests found
......@@ -35,6 +35,10 @@ local function screwdriver_handler(itemstack, user, pointed_thing, mode)
local node = minetest.get_node(pos)
local ndef = minetest.registered_nodes[node.name]
-- verify node is facedir (expected to be rotatable)
if ndef.paramtype2 ~= "facedir" then
return
end
-- Compute param2
local rotationPart = node.param2 % 32 -- get first 4 bits
local preservePart = node.param2 - rotationPart
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment