Fix team auto-assign logic in lobby state

Replaced `members.add` with `join` to correctly integrate new players into teams during the lobby phase. This ensures proper team setup and adherence to game mechanics.
This commit is contained in:
2025-02-02 14:12:25 +01:00
parent c6a7107ec2
commit 93ab1a50f3
@@ -139,7 +139,7 @@ data class TNTLeagueTeam(val config: TeamConfig) {
if (TNTLeagueGame.state == TNTLeagueGame.GameState.LOBBY) {
if (members.isEmpty()) {
plugin.server.onlinePlayers.firstOrNull { it != player && TNTLeagueGame.getTeam(it) == null }?.run {
members.add(this)
join(this)
}
}
if (leader == player) {