Update init.lua

Check if the player exists before doing warp queue.
This commit is contained in:
James Stevenson 2015-09-09 07:41:11 -04:00
parent 0f2900fa55
commit aa772124b3

View File

@ -46,6 +46,7 @@ do_warp_queue = function()
local t = minetest.get_us_time() local t = minetest.get_us_time()
for i = table.getn(warps_queue),1,-1 do for i = table.getn(warps_queue),1,-1 do
local e = warps_queue[i] local e = warps_queue[i]
if e.p:getpos() then
if e.p:getpos().x == e.pos.x and e.p:getpos().y == e.pos.y and e.p:getpos().z == e.pos.z then if e.p:getpos().x == e.pos.x and e.p:getpos().y == e.pos.y and e.p:getpos().z == e.pos.z then
if t > e.t then if t > e.t then
warp(e.p, e.w) warp(e.p, e.w)
@ -57,6 +58,7 @@ do_warp_queue = function()
table.remove(warps_queue, i) table.remove(warps_queue, i)
end end
end end
end
if table.getn(warps_queue) == 0 then if table.getn(warps_queue) == 0 then
queue_state = 0 queue_state = 0
return return