mirror of
https://github.com/Team254/cheesy-arena-lite.git
synced 2026-03-09 13:46:44 -04:00
Refactor playoff match generation logic to only generate the minimum number of matches needed in each iteration.
This commit is contained in:
@@ -436,12 +436,14 @@ func (web *Web) commitMatchScore(match *model.Match, matchResult *model.MatchRes
|
||||
}
|
||||
|
||||
if match.ShouldUpdateEliminationMatches() {
|
||||
if err = tournament.UpdateAlliance(web.arena.Database, [3]int{match.Red1, match.Red2, match.Red3},
|
||||
match.ElimRedAlliance); err != nil {
|
||||
if err = tournament.UpdateAlliance(
|
||||
web.arena.Database, [3]int{match.Red1, match.Red2, match.Red3}, match.ElimRedAlliance,
|
||||
); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = tournament.UpdateAlliance(web.arena.Database, [3]int{match.Blue1, match.Blue2, match.Blue3},
|
||||
match.ElimBlueAlliance); err != nil {
|
||||
if err = tournament.UpdateAlliance(
|
||||
web.arena.Database, [3]int{match.Blue1, match.Blue2, match.Blue3}, match.ElimBlueAlliance,
|
||||
); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user