Fix crash in remove_match_player when testing alone

master
shivajiva101 2020-09-05 22:24:59 +01:00 committed by GitHub
parent 9399bfaa11
commit 0d340571ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 10 deletions

View File

@ -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!"