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
else
local spawn = {x=0,y=0,z=0}
local s = minetest.settings:get("static_spawnpoint")
if s then
local numbers = string.split(s, ",")
spawn.x = tonumber(numbers[1])
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
local ssp = minetest.setting_get_pos("static_spawnpoint")
if ssp then
spawn = ssp
if type(spawn) ~= "table" or type(spawn.x) ~= "number" or type(spawn.y) ~= "number" or type(spawn.z) ~= "number" then
spawn = {x=0,y=0,z=0}
end
end