prevent to display winner message if match is not ended

This commit is contained in:
Beu 2023-09-09 00:43:51 +02:00
parent 81f062d54c
commit b9fcc221b4

View File

@ -8,7 +8,7 @@
#Extends "Libs/Nadeo/TMNext/TrackMania/Modes/TMNextRoundsBase.Script.txt" #Extends "Libs/Nadeo/TMNext/TrackMania/Modes/TMNextRoundsBase.Script.txt"
#Const CompatibleMapTypes "TrackMania\\TM_Race,TM_Race" #Const CompatibleMapTypes "TrackMania\\TM_Race,TM_Race"
#Const Version "2023-08-08" #Const Version "2023-09-09"
#Const ScriptName "Modes/TM2020-Gamemodes/TM_ReverseCup.Script.txt" #Const ScriptName "Modes/TM2020-Gamemodes/TM_ReverseCup.Script.txt"
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //
@ -503,8 +503,9 @@ if (MB_MatchIsRunning()) {
*** ***
ModeUtils::PlaySound(CUIConfig::EUISound::EndRound, 0); ModeUtils::PlaySound(CUIConfig::EUISound::EndRound, 0);
declare Text[] WinnersNames; if (!MB_Private_SkipPodiumSequence) {
foreach (Player in Players) { declare Text[] WinnersNames;
foreach (Player in Players) {
if(!Spectators.exists(Player)) { if(!Spectators.exists(Player)) {
if (Scores::GetPlayerMatchPoints(Player.Score) >= C_Points_LastChance) { if (Scores::GetPlayerMatchPoints(Player.Score) >= C_Points_LastChance) {
if (Player.User.ClubTag == "") { if (Player.User.ClubTag == "") {
@ -514,15 +515,15 @@ foreach (Player in Players) {
} }
} }
} }
} }
if(WinnersNames.count >= 1) { if(WinnersNames.count >= 1) {
UIModules_BigMessage::SetMessage(TL::Compose(_("$<%1$> wins the match!"), TL::Join(", ", WinnersNames))); UIModules_BigMessage::SetMessage(TL::Compose(_("$<%1$> wins the match!"), TL::Join(", ", WinnersNames)));
UIManager.UIAll.SendChat(TL::Compose(_("$<%1$> wins the match!"), TL::Join(", ", WinnersNames))); UIManager.UIAll.SendChat(TL::Compose(_("$<%1$> wins the match!"), TL::Join(", ", WinnersNames)));
} else { } else {
UIModules_BigMessage::SetMessage(_("|Match|Draw")); UIModules_BigMessage::SetMessage(_("|Match|Draw"));
}
} }
*** ***
***Match_PodiumSequence*** ***Match_PodiumSequence***