ignore static spawnpoint if compass has lodestone meta

This commit is contained in:
chmodsayshello 2022-03-28 09:12:55 +00:00
parent 97b10f15ef
commit d8986b4a4c
1 changed files with 2 additions and 2 deletions

View File

@ -24,7 +24,7 @@ function mcl_compass.get_compass_image(pos, dir, x, y, z)
if dim == playerdim then --Check if player and compass target are in the same dimension, above check is just if the diemension is valid for the non lodestone compass
local spawn = {x=x,y=y,z=z}
local ssp = minetest.setting_get_pos("static_spawnpoint")
if ssp then
if ssp and x == 0 and y == 0 and z == 0 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}
@ -45,7 +45,7 @@ function mcl_compass.get_compass_image(pos, dir, x, y, z)
if dim == playerdim then --already explained that very same if statement above
local spawn = {x=x,y=y,z=z}
local ssp = minetest.setting_get_pos("static_spawnpoint")
if ssp then
if ssp and x == 0 and y == 0 and z == 0 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}