fix newspawn timeout callback, delay player onjoin spawn call

This commit is contained in:
Tai Kedzierski 2018-12-28 05:17:16 +00:00
parent 9f529d148a
commit 56978417d0
2 changed files with 6 additions and 4 deletions

View File

@ -79,7 +79,7 @@ minetest.register_globalstep(function(dtime)
playertime = playertime - shavetime
if playertime <= 0 then
newspawn_cooldown[playername] = nil
minetest.chat_send_player("/newspawn available")
minetest.chat_send_player(playername, "/newspawn available")
else
newspawn_cooldown[playername] = playertime
end

View File

@ -167,9 +167,11 @@ end
minetest.register_on_joinplayer(function(player)
-- Use the recursive mode - it is not acceptable for a player
-- not to receive a randomized spawn
if not rspawn.playerspawns[player:get_player_name()] then
rspawn:double_set_new_playerspawn(player, 10)
end
minetest.after(1,function()
if not rspawn.playerspawns[player:get_player_name()] then
rspawn:double_set_new_playerspawn(player, 10)
end
end)
end)
minetest.register_on_respawnplayer(function(player)