mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-17 16:41:06 +01:00
Tweak spawning algorithm
This commit is contained in:
parent
daed3059bf
commit
9057743eb8
1 changed files with 7 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue