Skip to content
Permalink
Browse files

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.
  • Loading branch information
sfan5 committed Apr 4, 2020
1 parent fbbc7fc commit 8863527bb62c0cb3bf19d6d2acf6ecb817e61cc2
Showing with 2 additions and 3 deletions.
  1. +2 −3 mods/spawn/init.lua
@@ -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)
@@ -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.
You can’t perform that action at this time.