From 2d418e2ab800f6565c828cf5c30642e9dfd6da28 Mon Sep 17 00:00:00 2001 From: smk Date: Sat, 29 May 2021 22:41:07 +0530 Subject: [PATCH] Correct static_spawnpoint distance calculations --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index b896083..f206924 100755 --- a/init.lua +++ b/init.lua @@ -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