forked from mtcontrib/minetest-toolranks
added nil check
added nil check to create_description function
This commit is contained in:
parent
dbfa254de3
commit
3f94d76e53
4
init.lua
4
init.lua
@ -28,8 +28,8 @@ function toolranks.create_description(name, uses, level)
|
|||||||
local tooltype = toolranks.get_tool_type(description)
|
local tooltype = toolranks.get_tool_type(description)
|
||||||
|
|
||||||
local newdesc = toolranks.colors.green .. description .. "\n" ..
|
local newdesc = toolranks.colors.green .. description .. "\n" ..
|
||||||
toolranks.colors.gold .. "Level " .. level .. " " .. tooltype .. "\n" ..
|
toolranks.colors.gold .. "Level " .. (level or 1) .. " " .. tooltype .. "\n" ..
|
||||||
toolranks.colors.grey .. "Nodes dug: " .. uses
|
toolranks.colors.grey .. "Nodes dug: " .. (uses or 0)
|
||||||
|
|
||||||
return newdesc
|
return newdesc
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user