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

View File

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