Add missing infotext to nodes (#2477)

This commit is contained in:
An0n3m0us
2019-09-14 19:30:26 +01:00
committed by sfan5
parent 888383a812
commit 1f7ea89cb6
4 changed files with 35 additions and 19 deletions

View File

@ -200,7 +200,7 @@ local function furnace_node_timer(pos, elapsed)
if fuel and fuel_totaltime > fuel.time then
fuel_totaltime = fuel.time
end
if srclist[1]:is_empty() then
if srclist and srclist[1]:is_empty() then
src_time = 0
end
@ -218,10 +218,10 @@ local function furnace_node_timer(pos, elapsed)
item_state = S("@1%", item_percent)
end
else
if srclist[1]:is_empty() then
item_state = S("Empty")
else
if srclist and not srclist[1]:is_empty() then
item_state = S("Not cookable")
else
item_state = S("Empty")
end
end
@ -238,7 +238,7 @@ local function furnace_node_timer(pos, elapsed)
-- make sure timer restarts automatically
result = true
else
if not fuellist[1]:is_empty() then
if fuellist and not fuellist[1]:is_empty() then
fuel_state = S("@1%", 0)
end
formspec = default.get_furnace_inactive_formspec()
@ -291,11 +291,11 @@ minetest.register_node("default:furnace", {
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec", default.get_furnace_inactive_formspec())
local inv = meta:get_inventory()
inv:set_size('src', 1)
inv:set_size('fuel', 1)
inv:set_size('dst', 4)
furnace_node_timer(pos, 0)
end,
on_metadata_inventory_move = function(pos)

View File

@ -2602,7 +2602,12 @@ local function register_sign(material, desc, def)
text .. "\" to sign at " .. minetest.pos_to_string(pos))
local meta = minetest.get_meta(pos)
meta:set_string("text", text)
meta:set_string("infotext", '"' .. text .. '"')
if #text > 0 then
meta:set_string("infotext", '"' .. text .. '"')
else
meta:set_string("infotext", '')
end
end,
})
end