From bc4e940c80d30cdaa92f37d624470ad8501b3b4a Mon Sep 17 00:00:00 2001 From: Dirk Sohler Date: Tue, 11 Aug 2020 21:33:14 +0200 Subject: [PATCH] fix bug in size setting sanitizing --- system/on_receive_fields.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/system/on_receive_fields.lua b/system/on_receive_fields.lua index 0f26aaa..aa853b5 100644 --- a/system/on_receive_fields.lua +++ b/system/on_receive_fields.lua @@ -135,7 +135,8 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) -- Set size (scaling) of the timer HUD element if formname == 'mtimer:hud_element_size' then local attr = m.meta.hud_element_size - local value = tonumber(fields.hud_element_size or attr.default) + local default = tonumber(attr.default) + local value = tonumber(fields.hud_element_size) or default if fields.add then value = value + 1 end if fields.substract then value = value - 1 end