fix newspawn timeout callback, delay player onjoin spawn call
This commit is contained in:
parent
9f529d148a
commit
56978417d0
@ -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
|
||||
|
8
init.lua
8
init.lua
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user