diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-06-20 23:17:28 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-06-20 23:17:28 -0400 |
commit | 406fc323645878c6cdbd0033f504b80fdd4062d2 (patch) | |
tree | 0751c521d8d475472a270739740b44e07880b18b /troublemaker.cpp | |
parent | 7959b99c54473505ee37e35e7a32133d143ee5a9 (diff) | |
download | troublemaker-406fc323645878c6cdbd0033f504b80fdd4062d2.tar.gz troublemaker-406fc323645878c6cdbd0033f504b80fdd4062d2.tar.bz2 troublemaker-406fc323645878c6cdbd0033f504b80fdd4062d2.zip |
Fixed bug with rotating stats
Diffstat (limited to 'troublemaker.cpp')
-rw-r--r-- | troublemaker.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/troublemaker.cpp b/troublemaker.cpp index d924894..04417d7 100644 --- a/troublemaker.cpp +++ b/troublemaker.cpp | |||
@@ -184,7 +184,7 @@ int main(int argc, char** argv) | |||
184 | std::lock_guard<std::mutex> stats_guard(stats_mutex); | 184 | std::lock_guard<std::mutex> stats_guard(stats_mutex); |
185 | std::ofstream datafile("data.txt", std::ofstream::out | std::ofstream::trunc); | 185 | std::ofstream datafile("data.txt", std::ofstream::out | std::ofstream::trunc); |
186 | 186 | ||
187 | for (auto mapping : stats) | 187 | for (auto& mapping : stats) |
188 | { | 188 | { |
189 | auto& s = mapping.second; | 189 | auto& s = mapping.second; |
190 | if (s.days < 7) | 190 | if (s.days < 7) |
@@ -198,6 +198,7 @@ int main(int argc, char** argv) | |||
198 | s.day4 = s.day3; | 198 | s.day4 = s.day3; |
199 | s.day3 = s.day2; | 199 | s.day3 = s.day2; |
200 | s.day2 = s.day1; | 200 | s.day2 = s.day1; |
201 | s.day1 = 0; | ||
201 | 202 | ||
202 | s.total = s.day2 + s.day3 + s.day4 + s.day5 + s.day6 + s.day7; | 203 | s.total = s.day2 + s.day3 + s.day4 + s.day5 + s.day6 + s.day7; |
203 | 204 | ||