Fix crash on game exit

Game would crash entirely on exit if `spawnpoint.pos` was `nil` because `minetest.pos_to_string` would fail.
master
octacian 2017-03-22 22:25:45 -07:00
parent 018d1050d7
commit 10e61f6da4
1 changed files with 3 additions and 1 deletions

View File

@ -40,7 +40,9 @@ end
-- [function] Save
function spawnpoint.save()
io.open(path, "w"):write(minetest.pos_to_string(spawnpoint.pos))
if spawnpoint.pos then
io.open(path, "w"):write(minetest.pos_to_string(spawnpoint.pos))
end
end
-- [function] Set