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 str = minetest.pos_to_string(pos)
|
||||
minetest.settings:set("static_spawnpoint", str)
|
||||
minetest.settings:save()
|
||||
minetest.settings:write()
|
||||
return true, "Set the world's spawn point to " .. str
|
||||
end
|
||||
})
|
||||
|
@ -54,12 +54,14 @@ sethome.get = function(name, target)
|
||||
return targ, target
|
||||
end
|
||||
|
||||
sethome.go = function(name,point)
|
||||
sethome.go = function(name,point,skipsave)
|
||||
local pos, target = sethome.get(name,point)
|
||||
local player = minetest.get_player_by_name(name)
|
||||
|
||||
if player and pos then
|
||||
if not skipsave then
|
||||
ess.save_player_pos(player)
|
||||
end
|
||||
player:set_pos(pos)
|
||||
return true, target
|
||||
end
|
||||
@ -180,6 +182,6 @@ end
|
||||
|
||||
if homerespawn then
|
||||
minetest.register_on_respawnplayer(function(player)
|
||||
return sethome.go(player:get_player_name())
|
||||
return sethome.go(player:get_player_name(), nil, true)
|
||||
end)
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user