Fix respawn not working at all when suitable position was not found 5.2.0
authorsfan5 <sfan5@live.de>
Fri, 3 Apr 2020 19:41:26 +0000 (21:41 +0200)
committersfan5 <sfan5@live.de>
Sat, 4 Apr 2020 11:06:40 +0000 (13:06 +0200)
The player should always be teleported away when they die and
we can still fall back to the engine spawning code.

mods/spawn/init.lua

index 0e1261e6041650305aac2aec95ca55682767eac3..12c957f99cfc92e2433788c5202cfa809fa5b318 100644 (file)
@@ -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)