1
0
mirror of https://github.com/minetest/minetest_game.git synced 2024-12-23 07:10:19 +01:00

Fix respawn not working at all when suitable position was not found

The player should always be teleported away when they die and
we can still fall back to the engine spawning code.
This commit is contained in:
sfan5 2020-04-03 21:41:26 +02:00
parent fbbc7fc996
commit 8863527bb6

View File

@ -135,6 +135,7 @@ local function on_spawn(player)
if success then if success then
player:set_pos(spawn_pos) player:set_pos(spawn_pos)
end end
return success
end end
minetest.register_on_newplayer(function(player) minetest.register_on_newplayer(function(player)
@ -153,7 +154,5 @@ minetest.register_on_respawnplayer(function(player)
return return
end end
on_spawn(player) return on_spawn(player)
return true
end) end)