Rename README to README.md and make autotool.select_best_tool return best_time
+++ /dev/null
-# autotool
-A dragonfire CSM to automatically select the best tool for digging a node
--- /dev/null
+# autotool
+A dragonfire CSM to automatically select the best tool for digging a node
end
function autotool.select_best_tool(nodename)
- minetest.localplayer:set_wield_index(find_best_tool(nodename))
+ local new_index, best_time = find_best_tool(nodename)
+ minetest.localplayer:set_wield_index(new_index)
+ return best_time
end
local new_index, old_index, pointed_pos, best_time