From 4858c2b3fbafc0521bb1be72b776cd780cb39480 Mon Sep 17 00:00:00 2001 From: tuedel Date: Sun, 26 Jul 2020 11:07:15 +0200 Subject: [PATCH] sethome: Replace deprecated function calls (#2724) --- mods/sethome/init.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mods/sethome/init.lua b/mods/sethome/init.lua index 71874a99..9fc8e6ac 100644 --- a/mods/sethome/init.lua +++ b/mods/sethome/init.lua @@ -29,7 +29,8 @@ sethome.set = function(name, pos) if not player or not pos then return false end - player:set_attribute("sethome:home", minetest.pos_to_string(pos)) + local player_meta = player:get_meta() + player_meta:set_string("sethome:home", minetest.pos_to_string(pos)) -- remove `name` from the old storage file if not homepos[name] then @@ -51,7 +52,8 @@ end sethome.get = function(name) local player = minetest.get_player_by_name(name) - local pos = minetest.string_to_pos(player:get_attribute("sethome:home")) + local player_meta = player:get_meta() + local pos = minetest.string_to_pos(player_meta:get_string("sethome:home")) if pos then return pos end