forked from mtcontrib/minetest-toolranks
Only count nodes that spend the tool.
This commit is contained in:
parent
61fde54efc
commit
2a62b23076
@ -1,2 +1,4 @@
|
||||
12.7.2017
|
||||
- Fixed bug making Minetest crash when dug nodes exceed 799
|
||||
13.7.2017
|
||||
- Only count nodes that spend the tool
|
||||
|
6
init.lua
6
init.lua
@ -55,8 +55,10 @@ function toolranks.new_afteruse(itemstack, user, node, digparams)
|
||||
local dugnodes = tonumber(itemmeta:get_string("dug")) or 0 -- Number of nodes dug
|
||||
local lastlevel = tonumber(itemmeta:get_string("lastlevel")) or 1 -- Level the tool had
|
||||
-- on the last dig
|
||||
|
||||
dugnodes = dugnodes + 1
|
||||
-- Only count nodes that spend the tool
|
||||
if(digparams.wear > 0) then
|
||||
dugnodes = dugnodes + 1
|
||||
end
|
||||
|
||||
level = toolranks.get_level(dugnodes)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user