Removed a few afters thanks to MT 5.4 (fixes invisible former spectator names too)
parent
d67355b85f
commit
a7fb09c878
|
@ -230,13 +230,6 @@ function arena_lib.end_arena(mod_ref, mod, arena, winner_name, is_forced)
|
||||||
players_in_game[sp_name] = nil
|
players_in_game[sp_name] = nil
|
||||||
|
|
||||||
operations_before_leaving_arena(mod_ref, arena, sp_name)
|
operations_before_leaving_arena(mod_ref, arena, sp_name)
|
||||||
|
|
||||||
-- TEMP: 5.4, senza after non teletrasporta dove dovrebbe. Si veda https://github.com/minetest/minetest/pull/10235
|
|
||||||
minetest.after(0.1, function()
|
|
||||||
local spectator = minetest.get_player_by_name(sp_name)
|
|
||||||
spectator:set_pos(mod_ref.settings.hub_spawn_point)
|
|
||||||
end)
|
|
||||||
--^-----------------------------------------------------^
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- rimozione giocatori
|
-- rimozione giocatori
|
||||||
|
@ -434,17 +427,12 @@ function arena_lib.remove_player_from_arena(p_name, reason, executioner)
|
||||||
|
|
||||||
arena_lib.leave_spectate_mode(p_name)
|
arena_lib.leave_spectate_mode(p_name)
|
||||||
|
|
||||||
-- TEMP: 5.4, senza after non teletrasporta dove dovrebbe. Si veda https://github.com/minetest/minetest/pull/10235
|
|
||||||
-- Quando sistemato, basta eseguire solo operations_before_leaving_arena
|
|
||||||
if reason ~= 0 then
|
if reason ~= 0 then
|
||||||
minetest.after(0.1, function()
|
operations_before_leaving_arena(mod_ref, arena, p_name)
|
||||||
operations_before_leaving_arena(mod_ref, arena, p_name)
|
|
||||||
arena.past_present_players_inside[p_name] = nil
|
|
||||||
end)
|
|
||||||
else
|
|
||||||
arena.past_present_players_inside[p_name] = nil
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
arena.past_present_players_inside[p_name] = nil
|
||||||
|
|
||||||
handle_leaving_callbacks(mod_ref, arena, p_name, reason, executioner, true)
|
handle_leaving_callbacks(mod_ref, arena, p_name, reason, executioner, true)
|
||||||
players_in_game[p_name] = nil
|
players_in_game[p_name] = nil
|
||||||
|
|
||||||
|
|
|
@ -113,17 +113,9 @@ function arena_lib.leave_spectate_mode(p_name, to_join_match)
|
||||||
end
|
end
|
||||||
|
|
||||||
player:set_detach()
|
player:set_detach()
|
||||||
|
player:set_properties(players_in_spectate_mode[p_name].properties)
|
||||||
player:get_meta():set_int("arenalib_watchID", 0)
|
player:get_meta():set_int("arenalib_watchID", 0)
|
||||||
|
|
||||||
-- mantengo l'intangibilità per 0.1 secondi a causa del teletrasporto in 0.1 secondi di ritardo. Si veda https://github.com/minetest/minetest/pull/10235
|
|
||||||
local properties = table.copy(players_in_spectate_mode[p_name].properties)
|
|
||||||
|
|
||||||
minetest.after(0.1, function()
|
|
||||||
if not player then return end
|
|
||||||
player:set_properties(properties)
|
|
||||||
end)
|
|
||||||
--^---------------------------------------------------------------------------------------------^
|
|
||||||
|
|
||||||
arena_lib.HUD_hide("hotbar", p_name)
|
arena_lib.HUD_hide("hotbar", p_name)
|
||||||
|
|
||||||
local target = players_in_spectate_mode[p_name].spectating
|
local target = players_in_spectate_mode[p_name].spectating
|
||||||
|
|
Loading…
Reference in New Issue