Skip to content

Commit

Permalink
Reset the result of the race before spawning the players at the begin…
Browse files Browse the repository at this point in the history
…ning of the round.

This prevent players that do not spawn to have their latest race saved in the CurRace variable.
  • Loading branch information
Aessi committed Mar 27, 2018
1 parent 171508f commit 973552a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion Common/Scripts/Modes/TrackMania/Base/RoundsBase2.Script.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
#Extends "Modes/TrackMania/Base/ModeTrackmania.Script.txt"

#Const RoundsBaseVersion "2018-03-08"
#Const RoundsBaseVersion "2018-03-27"
#Const RoundsBaseScriptName "Modes/TrackMania/RoundsBase2.Script.txt"
// ---------------------------------- //
// Libraries
Expand Down Expand Up @@ -144,6 +144,12 @@ foreach (Score in Scores) {
Scores::SetPlayerRoundPoints(Score, 0);
}

// ---------------------------------- //
// Reset race result
foreach (Player in AllPlayers) {
Player.CurRace = Null;
}

// ---------------------------------- //
// Setup pause
if (Pause::IsActive()) {
Expand Down
2 changes: 1 addition & 1 deletion Common/Scripts/Modes/TrackMania/Cup.Script.txt
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ Boolean MatchIsOver() {
// If there's only one player he needs to reach the points limit to win
// If there's more than one player then all players except one must reach the points limit
declare PlayerWinnersLimit = ML::Max(Players.count - 1, 1);
Log::Log(""""[Cup] Match is over ? {{{(NbOfScoreWinners >= S_NbOfWinners || NbOfPlayerWinners >= PlayerWinnersLimit)}}} | ({{{NbOfScoreWinners}}} >= {{{S_NbOfWinners}}} || {{{NbOfPlayerWinners}}} >= {{{PlayerWinnersLimit}}})""");
Log::Log("""[Cup] Match is over ? {{{(NbOfScoreWinners >= S_NbOfWinners || NbOfPlayerWinners >= PlayerWinnersLimit)}}} | ({{{NbOfScoreWinners}}} >= {{{S_NbOfWinners}}} || {{{NbOfPlayerWinners}}} >= {{{PlayerWinnersLimit}}})""");
if (NbOfScoreWinners >= S_NbOfWinners || NbOfPlayerWinners >= PlayerWinnersLimit) return True;

return False;
Expand Down

0 comments on commit 973552a

Please sign in to comment.