Skip to content

Commit

Permalink
Merge pull request #343 from PyPlanet/bugfix/327
Browse files Browse the repository at this point in the history
[BUGFIX] Don't set the fastest time of your spectator as your fast ro…
  • Loading branch information
tomvlk committed Jun 3, 2017
2 parents 612c0fe + a67c826 commit ff45697
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ main() {
if (GUIPlayer == Null || Event.Player != GUIPlayer) {
continue;
}
declare Boolean IsSpectating = GUIPlayer != InputPlayer;

if (Event.Type == CTmRaceClientEvent::EType::Respawn) {
if (GUIPlayer != Null && GUIPlayer.RaceState != CTmMlPlayer::ERaceState::Running) {
CurrentCheckpointScores = Integer[];
Expand All @@ -161,7 +163,7 @@ main() {

if (Event.IsEndLap) {
CurrentCheckpoint = 0;
if ((BestScore <= 0 || Event.LapTime < BestScore) && CurrentCheckpointScores.count == TotalCheckpoints) {
if (! IsSpectating && (BestScore <= 0 || Event.LapTime < BestScore) && CurrentCheckpointScores.count == TotalCheckpoints) {
BestScore = Event.LapTime;
BestSource = "Round";
BestCheckpoints = CurrentCheckpointScores;
Expand Down

0 comments on commit ff45697

Please sign in to comment.