by leetelate » Thu Sep 19, 2013 14:57
regular spawn is fine - this was the first spawn in a new world - i may have been spawned at ground level but there was nothing under me but a lot of down - i have also first-spawned inside a tree (black screen, punch breaks the tree and fixes it) and also have first-spawned into a ravine (totally black screen, nothing can be done but go to creative mode and drop some torches)
i play on damage=true and creative = false
this fixes the problem: (brings the player down to the ground or w/e that is not "air" - could possibly put the player in an ignore block but otherwise shouldn't be a problem
--spawnfix
minetest.register_on_joinplayer(function(player)
minetest.after(1, function()
local pos = player:getpos()
local p1 = {x=math.floor(pos.x),y=math.floor(pos.y),z=math.floor(pos.z)}
for y=p1.y,p1.y-50,-1 do
local p2 = {x=p1.x,y=p1.y,z=p1.z}
local znode = minetest.get_node(p2).name
if znode ~= "air" then
player:setpos(p2)
break
end --if
end --for
end) --after
end) --function
Last edited by
leetelate on Thu Sep 19, 2013 15:03, edited 1 time in total.
MT IS MC'S SMARTER BROTHER
minetest 0.4.8 compiled from latest git on linux mint 15 with qjoypad and wired 360 controller
freeminer, pilztest, buildcraft and next are the idea factories
my minetest page is
http://1337318.zymichost.com if zymic isn't down - meh, it is free...