Replace outdate get_attribute/set_attribute

This commit is contained in:
Wuzzy 2020-01-28 15:10:14 +01:00
parent 0735c7453b
commit 62b0cae05a

@ -34,10 +34,10 @@ function orienteering.toggle_time_mode(itemstack, user, pointed_thing)
--[[ Player attribute “orienteering:twelve”:
* "true": Use 12h mode for time
* "false" or unset: Use 24h mode for time ]]
if user:get_attribute("orienteering:twelve") == "true" then
user:set_attribute("orienteering:twelve", "false")
if user:get_meta():get_string("orienteering:twelve") == "true" then
user:get_meta():set_string("orienteering:twelve", "false")
else
user:set_attribute("orienteering:twelve", "true")
user:get_meta():set_string("orienteering:twelve", "true")
end
orienteering.update_hud_displays(user)
end
@ -347,7 +347,7 @@ function orienteering.update_hud_displays(player)
local minutes = totalminutes % 60
local hours = math.floor((totalminutes - minutes) / 60)
minutes = math.floor(minutes)
local twelve = player:get_attribute("orienteering:twelve") == "true"
local twelve = player:get_meta():get_string("orienteering:twelve") == "true"
if twelve then
if hours == 12 and minutes == 0 then
str_time = S("Time: noon")