Reverse and combine if statements in the screwdriver

This commit is contained in:
ShadowNinja 2014-01-16 18:39:19 -05:00
parent c971ec7dc7
commit 04e560328f
1 changed files with 44 additions and 46 deletions

View File

@ -72,11 +72,10 @@ local function screwdriver_handler(itemstack, user, pointed_thing)
end
local node = minetest.get_node(pos)
local ndef = minetest.registered_nodes[node.name]
if ndef and ndef.paramtype2 == "facedir" then
if ndef.drawtype == "nodebox" and ndef.node_box.type ~= "fixed" then
return
end
if node.param2 == nil then
if not ndef or not ndef.paramtype2 == "facedir" or
(ndef.drawtype == "nodebox" and
not ndef.node_box.type == "fixed") or
node.param2 == nil then
return
end
-- Get ready to set the param2
@ -127,7 +126,6 @@ local function screwdriver_handler(itemstack, user, pointed_thing)
itemstack:set_wear(item_wear)
return itemstack
end
end
minetest.register_craft({
output = "screwdriver:screwdriver",