From 9057743eb852dad7d615ad165a784534de0bd93a Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 8 Mar 2019 05:12:31 +0100 Subject: [PATCH] Tweak spawning algorithm --- mods/PLAYER/mcl_spawn/init.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mods/PLAYER/mcl_spawn/init.lua b/mods/PLAYER/mcl_spawn/init.lua index 746beeb84d..b8f3f0869b 100644 --- a/mods/PLAYER/mcl_spawn/init.lua +++ b/mods/PLAYER/mcl_spawn/init.lua @@ -20,10 +20,17 @@ mcl_spawn.get_spawn_pos = function(player) spawn = minetest.setting_get_pos("static_spawnpoint") custom_spawn = false end + -- We are getting desperate ... + -- Use the first spawn point of the player if not spawn or spawn == "" then local attr = player:get_meta():get_string("mcl_spawn:first_spawn") if attr ~= nil and attr ~= "" then + -- Adjust Y spawn = minetest.string_to_pos(attr) + local y = minetest.get_spawn_level(spawn.x, spawn.z) + if y then + spawn.y = y + end custom_spawn = false end end