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:
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 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
|
||||
|
|
Loading…
Reference in New Issue
Block a user