Use minetest.disconnect_player if available

master
Wuzzy 2022-01-31 00:02:02 +01:00
parent a3637d17af
commit 28d8c66f37
1 changed files with 7 additions and 1 deletions

View File

@ -1425,7 +1425,13 @@ end
minetest.register_on_player_receive_fields(function(player, formname, fields)
if(fields.leave) then
minetest.kick_player(player:get_player_name(), S("You have voluntarily exited the tutorial."))
local name = player:get_player_name()
local reason = S("You have voluntarily exited the tutorial.")
if minetest.disconnect_player then
minetest.disconnect_player(name, reason)
else
minetest.kick_player(name, reason)
end
return
elseif(fields.teleport) then
teleport_dialog(player)