Skip to content

Commit

Permalink
Fix respawn not working at all when suitable position was not found
Browse files Browse the repository at this point in the history
The player should always be teleported away when they die and
we can still fall back to the engine spawning code.
  • Loading branch information
sfan5 committed Apr 4, 2020
1 parent fbbc7fc commit 8863527
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions mods/spawn/init.lua
Expand Up @@ -135,6 +135,7 @@ local function on_spawn(player)
if success then
player:set_pos(spawn_pos)
end
return success
end

minetest.register_on_newplayer(function(player)
Expand All @@ -153,7 +154,5 @@ minetest.register_on_respawnplayer(function(player)
return
end

on_spawn(player)

return true
return on_spawn(player)
end)

0 comments on commit 8863527

Please sign in to comment.