From 092972ca4e2f8e9050eaa14f304e0d04f8cbee4a Mon Sep 17 00:00:00 2001 From: Raz Date: Mon, 26 May 2025 17:02:51 +0200 Subject: [PATCH] fix seed random pick missing for more than 32 players fix missing parameters taken from template --- PadelClubData/Data/Tournament.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/PadelClubData/Data/Tournament.swift b/PadelClubData/Data/Tournament.swift index d2b3331..6304f72 100644 --- a/PadelClubData/Data/Tournament.swift +++ b/PadelClubData/Data/Tournament.swift @@ -386,7 +386,8 @@ defer { case 24...31: return SeedInterval(first: 25, last: 32) default: - return nil + let pow = Int(pow(2.0, ceil(log2(Double(alreadySetupSeeds))))) + return SeedInterval(first: pow + 1, last: pow * 2) } } @@ -1735,13 +1736,15 @@ defer { self.maximumPlayerPerTeam = templateTournament.maximumPlayerPerTeam self.waitingListLimit = templateTournament.waitingListLimit self.teamCountLimit = templateTournament.teamCountLimit + self.teamCount = templateTournament.teamCount self.enableOnlinePayment = templateTournament.enableOnlinePayment self.onlinePaymentIsMandatory = templateTournament.onlinePaymentIsMandatory self.enableOnlinePaymentRefund = templateTournament.enableOnlinePaymentRefund self.stripeAccountId = templateTournament.stripeAccountId self.enableTimeToConfirm = templateTournament.enableTimeToConfirm self.isCorporateTournament = templateTournament.isCorporateTournament - + self.clubMemberFeeDeduction = templateTournament.clubMemberFeeDeduction + self.unregisterDeltaInHours = templateTournament.unregisterDeltaInHours if self.registrationDateLimit == nil, templateTournament.registrationDateLimit != nil { self.registrationDateLimit = startDate.truncateMinutesAndSeconds() }