1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-12-24 01:30:38 +01:00

Using static_spawnpoint in minetest.conf

- When return back from the nether, the player is teleported either to 5,
  35, -7 (something like that), or to the defined value of
  static_spawnpoint key in minetest.conf.
This commit is contained in:
LeMagnesium 2014-11-24 22:52:28 +01:00
parent cc2661f622
commit ccccd48a63

View File

@ -522,7 +522,12 @@ function nether_port(player, pos)
minetest.sound_play("nether_teleporter", {pos=pos})
if pos.y < nether.start then
player_from_nether(player)
player:moveto({x=5, y=35, z=-7})
local pos_togo = {x = 0, y = 35, z = -7}
if minetest.setting_getbool("static_spawnpoint") ~= nil then
stsp_conf = minetest.setting_get("static_spawnpoint")
pos_togo = {x = stsp_conf:split(",")[1],y = stsp_conf:split(",")[2],z = stsp_conf:split(",")[3]}
end
player:moveto(pos_togo)
else
player:moveto({x=pos.x, y=portal_target+math.random(4), z=pos.z})
player_to_nether(player, true)