forked from minetest/minetest_game
sethome: Replace deprecated function calls (#2724)
This commit is contained in:
parent
12f75ab803
commit
4858c2b3fb
|
@ -29,7 +29,8 @@ sethome.set = function(name, pos)
|
||||||
if not player or not pos then
|
if not player or not pos then
|
||||||
return false
|
return false
|
||||||
end
|
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
|
-- remove `name` from the old storage file
|
||||||
if not homepos[name] then
|
if not homepos[name] then
|
||||||
|
@ -51,7 +52,8 @@ end
|
||||||
|
|
||||||
sethome.get = function(name)
|
sethome.get = function(name)
|
||||||
local player = minetest.get_player_by_name(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
|
if pos then
|
||||||
return pos
|
return pos
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user