From 4f4a1c0373b0a0dbf004409e54ae24c952729331 Mon Sep 17 00:00:00 2001 From: hiker Date: Tue, 4 Aug 2015 17:14:36 +1000 Subject: [PATCH] Added support for reverse mode in history files. --- src/race/history.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/race/history.cpp b/src/race/history.cpp index ec65911f8..eba50e42b 100644 --- a/src/race/history.cpp +++ b/src/race/history.cpp @@ -269,7 +269,17 @@ void History::Load() Log::fatal("History", "No difficulty found in history file."); race_manager->setDifficulty((RaceManager::Difficulty)n); + + // Optional (not supported in older history files): include reverse fgets(s, 1023, fd); + char r; + if (!sscanf(s, "reverse: %c", &r) != 1) + { + fgets(s, 1023, fd); + race_manager->setReverseTrack(r == 'y'); + } + + if(sscanf(s, "track: %1023s",s1)!=1) Log::warn("History", "Track not found in history file."); race_manager->setTrack(s1);