Fix crash and tweak ctf_respawn_delay height
This commit is contained in:
parent
bf3fff7c53
commit
73e70fa29d
1 changed files with 8 additions and 2 deletions
|
@ -39,11 +39,11 @@ minetest.register_on_mods_loaded(function()
|
||||||
local pname = player:get_player_name()
|
local pname = player:get_player_name()
|
||||||
|
|
||||||
if ctf_respawn_delay.players[pname] and ctf_respawn_delay.players[pname].timeleft == "waiting" then
|
if ctf_respawn_delay.players[pname] and ctf_respawn_delay.players[pname].timeleft == "waiting" then
|
||||||
|
ctf_respawn_delay.players[pname].timeleft = RESPAWN_DELAY
|
||||||
local pos = player:get_pos()
|
local pos = player:get_pos()
|
||||||
pos.y = 500
|
pos.y = ctf_map.map.h/2 + 10
|
||||||
|
|
||||||
player:set_pos(pos) -- Player will be stuck there because CTF 'air' is walkable
|
player:set_pos(pos) -- Player will be stuck there because CTF 'air' is walkable
|
||||||
ctf_respawn_delay.players[pname].timeleft = RESPAWN_DELAY
|
|
||||||
minetest.after(RESPAWN_INTERVAL, respawnfunc, pname)
|
minetest.after(RESPAWN_INTERVAL, respawnfunc, pname)
|
||||||
|
|
||||||
return true
|
return true
|
||||||
|
@ -65,6 +65,12 @@ function respawnfunc(pname)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if type(ctf_respawn_delay.players[pname].timeleft) == "string" then
|
||||||
|
minetest.after(RESPAWN_INTERVAL, respawnfunc, pname)
|
||||||
|
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
ctf_respawn_delay.players[pname].timeleft = ctf_respawn_delay.players[pname].timeleft - 1
|
ctf_respawn_delay.players[pname].timeleft = ctf_respawn_delay.players[pname].timeleft - 1
|
||||||
local timeleft = ctf_respawn_delay.players[pname].timeleft
|
local timeleft = ctf_respawn_delay.players[pname].timeleft
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue