From 5c448a33aa6310d551062118f34f76d1886edd59 Mon Sep 17 00:00:00 2001 From: Zughy <4279489-marco_a@users.noreply.gitlab.com> Date: Sun, 24 Apr 2022 11:13:52 +0200 Subject: [PATCH] BUGFIX: spectators don't risk to end stuck anymore when leaving a match (TEMPFIX for #131, waiting for upstream) --- src/api/in_game.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/api/in_game.lua b/src/api/in_game.lua index 689fd0f..1df46e3 100755 --- a/src/api/in_game.lua +++ b/src/api/in_game.lua @@ -877,6 +877,11 @@ function operations_before_leaving_arena(mod_ref, arena, p_name, reason) local noise_z = math.random(-1.5, 1.5) local noise_pos = {x = clean_pos.x + noise_x, y = clean_pos.y, z = clean_pos.z + noise_z} player:set_pos(noise_pos) + -- TEMP: waiting for https://github.com/minetest/minetest/issues/12092 to be fixed. Forcing the teleport twice on two different steps + minetest.after(0.1, function() + if not minetest.get_player_by_name(p_name) then return end + player:set_pos(noise_pos) + end) -- se si รจ disconnesso, salta il resto if reason == 0 then