fix multiplayer crash
parent
4777f29ebd
commit
ab47b03932
|
@ -233,7 +233,7 @@ arena_lib.on_load("wormball", function(arena)
|
||||||
|
|
||||||
player:set_attach(att, "", {x=0,y=0,z=0}, {x=0,y=0,z=0})
|
player:set_attach(att, "", {x=0,y=0,z=0}, {x=0,y=0,z=0})
|
||||||
player_api.player_attached[pl_name] = true
|
player_api.player_attached[pl_name] = true
|
||||||
player:set_eye_offset(eye_offset, {x=0, y=0, z=0})
|
--player:set_eye_offset(eye_offset, {x=0, y=0, z=0})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -413,8 +413,9 @@ minetest.register_globalstep(function(dtime)
|
||||||
gain = 2.0,
|
gain = 2.0,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
arena.players[pl_name].alive = false
|
||||||
minetest.after(1, function(pl_name)
|
minetest.after(1, function(pl_name)
|
||||||
|
|
||||||
arena_lib.remove_player_from_arena(pl_name, 1)
|
arena_lib.remove_player_from_arena(pl_name, 1)
|
||||||
|
|
||||||
end,pl_name)
|
end,pl_name)
|
||||||
|
@ -433,12 +434,15 @@ minetest.register_globalstep(function(dtime)
|
||||||
if remove_tail == true then
|
if remove_tail == true then
|
||||||
local len = #arena.players[pl_name].nodes
|
local len = #arena.players[pl_name].nodes
|
||||||
local tail_pos = arena.players[pl_name].nodes[len]
|
local tail_pos = arena.players[pl_name].nodes[len]
|
||||||
minetest.set_node(tail_pos, {name="air"})
|
if tail_pos then
|
||||||
table.remove(arena.players[pl_name].nodes,len)
|
minetest.set_node(tail_pos, {name="air"})
|
||||||
|
table.remove(arena.players[pl_name].nodes,len)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if #arena.players[pl_name].nodes == 0 then
|
if #arena.players[pl_name].nodes == 0 then
|
||||||
minetest.chat_send_player(pl_name, 'Your score is '..arena.players[pl_name].score)
|
minetest.chat_send_player(pl_name, 'Your score is '..arena.players[pl_name].score)
|
||||||
|
arena.players[pl_name].alive = false
|
||||||
minetest.after(1,function(pl_name)
|
minetest.after(1,function(pl_name)
|
||||||
arena_lib.remove_player_from_arena(pl_name, 1)
|
arena_lib.remove_player_from_arena(pl_name, 1)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue