1
0
Fork 0

Item name HUD: Show itemstring as fallback

objects
Wuzzy 2017-06-05 22:47:50 +02:00
parent 4afb2d4066
commit d497205c98
1 changed files with 5 additions and 1 deletions

View File

@ -40,7 +40,11 @@ minetest.register_globalstep(function(dtime)
dtimes[player_name] = 0
if huds[player_name] then
local def = minetest.registered_items[wstack]
local desc = def and def.description or ""
local desc = def and def.description
if not desc or desc == "" then
-- Use itemstring as fallback
desc = wstack
end
-- Cut off item description after first newline
local firstnewline = string.find(desc, "\n")
if firstnewline then