tighten check on allowed values for hud_change

master^2
flux 2022-02-15 10:37:24 -08:00
parent 4dd748c7ac
commit e2d8c62935
1 changed files with 2 additions and 4 deletions

View File

@ -1,8 +1,6 @@
local mod_name = minetest.get_current_modname()
local hud_name = ("%s_feedback"):format(mod_name)
local is_multicraft = minetest.get_version().project == "MultiCraft"
local hud_info_by_player_name = {}
local hud_timeout_seconds = 3
@ -47,8 +45,8 @@ local function hud_update(player, player_name, hud_id, message, params)
local def = get_hud_def(message, params)
for key, value in pairs(def) do
-- multicraft has a bug that requires the "value" argument of hud_change to be a number
if not is_multicraft or type(value) == "number" then
-- minetest < 5.5 and multicraft can't handle changes to hud_elem_type
if key ~= "hud_elem_type" then
player:hud_change(hud_id, key, value)
end
end