diff --git a/README.md b/README.md index bc27661..f292ecb 100644 --- a/README.md +++ b/README.md @@ -37,10 +37,10 @@ yet and may not ever be ### [Splits.io](https://splits.io/) -[X] Import game, category and segment names from generic format -[] Import all information the generic format support i.e. run histories -[] Export runs in the generic format +- [X] Import game, category and segment names from generic format +- [ ] Import all information the generic format support i.e. run histories +- [ ] Export runs in the generic format ### [Speedrun.com](https://www.speedrun.com/) -[] Submit runs +- [ ] Submit runs diff --git a/src/timer.c b/src/timer.c index 66fd87c..1fb7e71 100644 --- a/src/timer.c +++ b/src/timer.c @@ -436,13 +436,17 @@ void calculateBestSegs() if (attempts == 0) return; for (int i = 0; i < segCount; i++) { - int bms = INT_MAX; + int bestDuration = INT_MAX; for (int j = 0; j < attempts; j++) { - int cms = pastRuns[(j * segCount) + i].ms; - if (cms != 0 && cms < bms) - bms = cms; + int duration = pastRuns[(j * segCount) + i].ms; + if (i != 0) + duration -= bestsegs[i-1].ms; + if (duration != 0 && duration < bestDuration) + bestDuration = duration; } - bestsegs[i].ms = bms; + bestsegs[i].ms = bestDuration; + if (i != 0) + bestsegs[i].ms += bestsegs[i-1].ms; } }