Fix crash in remove_match_player when testing alone
parent
9399bfaa11
commit
0d340571ac
6
init.lua
6
init.lua
|
@ -460,6 +460,9 @@ local function remove_match_player(name)
|
|||
key = eggwars.player[name]
|
||||
match = eggwars.match[key]
|
||||
player = match.player[name]
|
||||
if match.alive == 1 then
|
||||
eggwars.end_match(key)
|
||||
else
|
||||
if player.egg then
|
||||
minetest.remove_node(player.eggpos)
|
||||
end
|
||||
|
@ -470,9 +473,6 @@ local function remove_match_player(name)
|
|||
match.player[name].egg = false
|
||||
eggwars.match[key] = match
|
||||
eggwars.player[name] = nil
|
||||
if match.alive == 1 then
|
||||
eggwars.end_match(key)
|
||||
else
|
||||
player = minetest.get_player_by_name(name)
|
||||
player:set_pos(lobby.pos)
|
||||
local msg = name .. " quit the match!"
|
||||
|
|
Loading…
Reference in New Issue