1
0
mirror of https://github.com/lisacvuk/minetest-toolranks.git synced 2024-11-14 14:00:21 +01:00

added nil check

added nil check to create_description function
This commit is contained in:
tenplus1 2017-09-29 16:08:55 +01:00 committed by GitHub
parent dbfa254de3
commit 3f94d76e53

View File

@ -28,8 +28,8 @@ function toolranks.create_description(name, uses, level)
local tooltype = toolranks.get_tool_type(description)
local newdesc = toolranks.colors.green .. description .. "\n" ..
toolranks.colors.gold .. "Level " .. level .. " " .. tooltype .. "\n" ..
toolranks.colors.grey .. "Nodes dug: " .. uses
toolranks.colors.gold .. "Level " .. (level or 1) .. " " .. tooltype .. "\n" ..
toolranks.colors.grey .. "Nodes dug: " .. (uses or 0)
return newdesc
end