]> git.lizzy.rs Git - autotool.git/commitdiff
Merge pull request #1 from Minetest-j45/master master
authorElias Fleckenstein <54945686+EliasFleckenstein03@users.noreply.github.com>
Sat, 27 Nov 2021 19:29:35 +0000 (20:29 +0100)
committerGitHub <noreply@github.com>
Sat, 27 Nov 2021 19:29:35 +0000 (20:29 +0100)
Rename README to README.md and make autotool.select_best_tool return best_time

README [deleted file]
README.md [new file with mode: 0644]
init.lua

diff --git a/README b/README
deleted file mode 100644 (file)
index 3158467..0000000
--- a/README
+++ /dev/null
@@ -1,2 +0,0 @@
-# autotool
-A dragonfire CSM to automatically select the best tool for digging a node
diff --git a/README.md b/README.md
new file mode 100644 (file)
index 0000000..3158467
--- /dev/null
+++ b/README.md
@@ -0,0 +1,2 @@
+# autotool
+A dragonfire CSM to automatically select the best tool for digging a node
index 2d50e263aab22a298c68c8a9a85ffffb28b3f868..bc9422ff7f390db470681b1ab23233dd0cb63a45 100644 (file)
--- a/init.lua
+++ b/init.lua
@@ -36,7 +36,9 @@ local function find_best_tool(nodename)
 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