mirror of
https://github.com/minetest-mods/technic.git
synced 2024-09-28 23:30:42 +02:00
Optimize check_if_node_sawed performance, shorten
This commit is contained in:
parent
717ad02350
commit
9786051860
|
@ -196,18 +196,11 @@ technic.register_power_tool("technic:chainsaw", chainsaw_max_charge)
|
||||||
|
|
||||||
-- This function checks if the specified node should be sawed
|
-- This function checks if the specified node should be sawed
|
||||||
local function check_if_node_sawed(pos)
|
local function check_if_node_sawed(pos)
|
||||||
|
local node_name = minetest.get_node(pos).name
|
||||||
if chainsaw_leaves then
|
if timber_nodenames[node_name]
|
||||||
if minetest.get_item_group( minetest.get_node(pos).name, "leaves" ) ~= 0
|
or (chainsaw_leaves and minetest.get_item_group(node_name, "leaves") ~= 0)
|
||||||
or minetest.get_item_group( minetest.get_node(pos).name, "tree" ) ~= 0
|
or minetest.get_item_group(node_name, "tree") ~= 0 then
|
||||||
or timber_nodenames[minetest.get_node(pos).name] then
|
return true
|
||||||
return true
|
|
||||||
end
|
|
||||||
else
|
|
||||||
if minetest.get_item_group( minetest.get_node(pos).name, "tree" ) ~= 0
|
|
||||||
or timber_nodenames[minetest.get_node(pos).name] then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return false
|
return false
|
||||||
|
|
Loading…
Reference in New Issue
Block a user