Correct static_spawnpoint distance calculations

master
smk 2021-05-29 22:41:07 +05:30 committed by GitHub
parent c50d0aa303
commit 2d418e2ab8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -14,7 +14,7 @@ function teleport_to_spawn(name)
return false
end
local pos = player:get_pos()
if pos.x>-20 and pos.x<20 and pos.z>-20 and pos.z<20 then
if math.abs(spawn_command.pos.x-pos.x)<20 and math.abs(spawn_command.pos.z-pos.z)<20 then
minetest.chat_send_player(name, "Already close to spawn!")
elseif cursed_world_exists and _G['cursed_world'] ~= nil and --check global table for cursed_world mod
cursed_world.location_y and cursed_world.dimension_y and