Fix crash on join w/ compass + static_spawnpoint set in bracket format

This commit is contained in:
Wuzzy 2017-11-05 02:50:31 +01:00
parent 5403a97a56
commit 6ff1be07cb

@ -36,13 +36,10 @@ minetest.register_globalstep(function(dtime)
compass_image = random_frame compass_image = random_frame
else else
local spawn = {x=0,y=0,z=0} local spawn = {x=0,y=0,z=0}
local s = minetest.settings:get("static_spawnpoint") local ssp = minetest.setting_get_pos("static_spawnpoint")
if s then if ssp then
local numbers = string.split(s, ",") spawn = ssp
spawn.x = tonumber(numbers[1]) if type(spawn) ~= "table" or type(spawn.x) ~= "number" or type(spawn.y) ~= "number" or type(spawn.z) ~= "number" then
spawn.y = tonumber(numbers[2])
spawn.z = tonumber(numbers[3])
if type(spawn.x) ~= "number" and type(spawn.y) ~= "number" and type(spawn.z) ~= "number" then
spawn = {x=0,y=0,z=0} spawn = {x=0,y=0,z=0}
end end
end end