Don't leave a party when disconnecting (closes #9) | Add setting to leave the party when players disconnect, off by default (closes #8)

This commit is contained in:
Zughy 2023-09-21 10:20:49 +02:00
parent 03cb6fdbdb
commit f72b18ed2f
2 changed files with 5 additions and 2 deletions

View File

@ -1,2 +1,5 @@
-- the maximum amount of players a party can have
parties.settings.MAX_PLAYERS_PER_PARTY = 6
parties.settings.MAX_PLAYERS_PER_PARTY = 6
-- whether players should automatically leave a party when disconnecting
parties.settings.LEAVE_ON_DISCONNECT = false

View File

@ -7,7 +7,7 @@ end)
minetest.register_on_leaveplayer(function(player)
local p_name = player:get_player_name()
if parties.is_player_in_party(p_name) then
if parties.is_player_in_party(p_name) and parties.settings.LEAVE_ON_DISCONNECT then
parties.leave(p_name)
end