fix bug in size setting sanitizing

This commit is contained in:
Dirk Sohler 2020-08-11 21:33:14 +02:00
parent a7e89e6c2e
commit bc4e940c80
No known key found for this signature in database
GPG Key ID: B9751241BD7D4E1A

@ -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