diff --git a/mods/bg_tree/decompose.lua b/mods/bg_tree/decompose.lua index 4bc970e..84a882a 100644 --- a/mods/bg_tree/decompose.lua +++ b/mods/bg_tree/decompose.lua @@ -27,11 +27,9 @@ blockgame.register_increasing_abm({ end, }) -local decompose_node_scores = { - [leaves_decomposing] = 30, -} -local decompose_group_scores = { +local decompose_scores = { dirty = 50, + leaves_decomposing = 30, } local decompose_cost = 2000 @@ -53,9 +51,10 @@ blockgame.register_increasing_abm({ local name = minetest.get_node(pos).name local gain = 0 - for group, value in pairs(decompose_group_scores) do - if minetest.get_item_group(name, group) > 0 then - gain = math.max(gain, value) + for group, value in pairs(decompose_scores) do + local group = minetest.get_item_group(name, group) + if group > 0 then + gain = math.max(gain, value * group) end end @@ -65,11 +64,6 @@ blockgame.register_increasing_abm({ score = score + gain return true end - - if decompose_node_scores[name] then - score = score + math.floor(decompose_node_scores[name] / distance) - return true - end end, 4) return data.value + score