Bufgix: the ball gets detached correctly on quit.

This commit is contained in:
_Zaizen_ 2020-11-06 23:49:26 +01:00
parent e2c2dde432
commit 2eef1abddc
2 changed files with 8 additions and 0 deletions

View File

@ -93,6 +93,9 @@ end)
arena_lib.on_quit("block_league", function(arena, p_name)
if minetest.get_player_by_name(p_name):get_children()[1] then
minetest.get_player_by_name(p_name):get_children()[1]:get_luaentity():detach()
end
remove_HUD(p_name)
reset_meta(p_name)
end)

View File

@ -79,6 +79,7 @@ function ball:on_activate(staticdata, d_time)
end
function ball:on_step(d_time, moveresult)
local id, arena = arena_lib.get_arena_by_name("block_league", self.arena.name)
@ -183,6 +184,8 @@ function ball:attach(player)
self.timer = 0
end
function ball:on_detach(parent)
self.wielder = parent
@ -191,6 +194,8 @@ function ball:on_detach(parent)
end
function ball:detach()
local player = self.wielder