forked from VoxeLibre/VoxeLibre
add support for static_spawnpoint back
This commit is contained in:
parent
0c2562b88c
commit
1735343c5e
|
@ -44,6 +44,13 @@ function mcl_compass.get_compass_image(pos, dir, itemstack)
|
||||||
end
|
end
|
||||||
else --no lodestone meta, normal compass....
|
else --no lodestone meta, normal compass....
|
||||||
local spawn = {x = 0, y=0, z=0} --before you guys tell me that the normal compass no points to real spawn, it always pointed to 0 0
|
local spawn = {x = 0, y=0, z=0} --before you guys tell me that the normal compass no points to real spawn, it always pointed to 0 0
|
||||||
|
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
|
||||||
|
|
||||||
if mcl_worlds.compass_works(pos) then --is the player in the overworld?
|
if mcl_worlds.compass_works(pos) then --is the player in the overworld?
|
||||||
local angle_north = math.deg(math.atan2(spawn.x - pos.x, spawn.z - pos.z))
|
local angle_north = math.deg(math.atan2(spawn.x - pos.x, spawn.z - pos.z))
|
||||||
|
|
Loading…
Reference in New Issue