From: Auke Kok Date: Thu, 24 Dec 2015 20:41:52 +0000 (-0800) Subject: Verify node type is facedir. X-Git-Tag: 0.4.14~174 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=82299b94dc6f661e0b97e6f747dee8c250a70aa8;p=oweals%2Fminetest_game.git 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 --- diff --git a/mods/screwdriver/init.lua b/mods/screwdriver/init.lua index 0c77754e..34b4b4a8 100644 --- a/mods/screwdriver/init.lua +++ b/mods/screwdriver/init.lua @@ -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