Fix crash when player dies and no maps are found

master
LoneWolfHT 2019-06-27 14:03:50 -07:00
parent 67c9cf42c5
commit a758a88b1e
1 changed files with 2 additions and 0 deletions

View File

@ -96,6 +96,8 @@ minetest.register_on_joinplayer(function(p)
end)
minetest.register_on_respawnplayer(function(p)
if not main.current_mode.playerspawns then return false end
p:set_pos(main.current_mode.playerspawns[math.random(1, #main.current_mode.playerspawns)])
return true