fix settings save, fix /back on death
This commit is contained in:
parent
596878a2c6
commit
4f4d7288ce
@ -36,7 +36,7 @@ spawn.register_chatcommand("setspawn", {
|
|||||||
local pos = minetest.get_player_by_name(name):get_pos(spawnpoint)
|
local pos = minetest.get_player_by_name(name):get_pos(spawnpoint)
|
||||||
local str = minetest.pos_to_string(pos)
|
local str = minetest.pos_to_string(pos)
|
||||||
minetest.settings:set("static_spawnpoint", str)
|
minetest.settings:set("static_spawnpoint", str)
|
||||||
minetest.settings:save()
|
minetest.settings:write()
|
||||||
return true, "Set the world's spawn point to " .. str
|
return true, "Set the world's spawn point to " .. str
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
@ -54,12 +54,14 @@ sethome.get = function(name, target)
|
|||||||
return targ, target
|
return targ, target
|
||||||
end
|
end
|
||||||
|
|
||||||
sethome.go = function(name,point)
|
sethome.go = function(name,point,skipsave)
|
||||||
local pos, target = sethome.get(name,point)
|
local pos, target = sethome.get(name,point)
|
||||||
local player = minetest.get_player_by_name(name)
|
local player = minetest.get_player_by_name(name)
|
||||||
|
|
||||||
if player and pos then
|
if player and pos then
|
||||||
ess.save_player_pos(player)
|
if not skipsave then
|
||||||
|
ess.save_player_pos(player)
|
||||||
|
end
|
||||||
player:set_pos(pos)
|
player:set_pos(pos)
|
||||||
return true, target
|
return true, target
|
||||||
end
|
end
|
||||||
@ -180,6 +182,6 @@ end
|
|||||||
|
|
||||||
if homerespawn then
|
if homerespawn then
|
||||||
minetest.register_on_respawnplayer(function(player)
|
minetest.register_on_respawnplayer(function(player)
|
||||||
return sethome.go(player:get_player_name())
|
return sethome.go(player:get_player_name(), nil, true)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user