From 85254384b50c9eea8186d305491a33f806eccfdf Mon Sep 17 00:00:00 2001 From: Beu Date: Sun, 22 Aug 2021 10:06:14 +0200 Subject: [PATCH] fix rounds counter in cup mode --- MatchManagerSuite/MatchManagerCore.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/MatchManagerSuite/MatchManagerCore.php b/MatchManagerSuite/MatchManagerCore.php index d02cc2f..3d27f1d 100644 --- a/MatchManagerSuite/MatchManagerCore.php +++ b/MatchManagerSuite/MatchManagerCore.php @@ -1376,8 +1376,9 @@ class MatchManagerCore implements CallbackListener, CommandListener, TimerListen if ($this->currentgmbase == "Champion") { $this->currentscore = array_merge($this->currentscore, array(array($rank, $player->login, $points , $result->getMapPoints(), $time, ""))); - } elseif ($this->currentgmbase == "Cup") { + } elseif ($this->currentgmbase == "Cup") { $this->currentscore = array_merge($this->currentscore, array(array($rank, $player->login, ($points + $roundpoints), $roundpoints, $time, "-1"))); + if ($roundpoints > 0) $atleastonefinished = true; // Round is skipped if no one finishes only in cup mode } elseif ($this->currentgmbase == "Rounds" ) { $this->currentscore = array_merge($this->currentscore, array(array($rank, $player->login, ($points + $roundpoints), $roundpoints, $time, "-1"))); } elseif ($this->currentgmbase == "Teams") { @@ -1403,7 +1404,9 @@ class MatchManagerCore implements CallbackListener, CommandListener, TimerListen } if (!$this->pauseon && !$this->skipround) { - $this->nbrounds++; + if ($this->currentgmbase != "Cup" || ($this->currentgmbase == "Cup" && isset($atleastonefinished) && $atleastonefinished)) { // Round is skipped if no one finishes only in cup mode + $this->nbrounds++; + } } if ($this->skipround) { $this->skipround = false;