fix: if the first lap is not valid the fastest lap will no longer be compared to the broken lap
This commit is contained in:
@@ -102,18 +102,19 @@ int QVectorHelper::getMinSec3(const QVector<QVector<int>> x) {
|
|||||||
|
|
||||||
int QVectorHelper::getMin(const QVector<QVector<int>> x) {
|
int QVectorHelper::getMin(const QVector<QVector<int>> x) {
|
||||||
int min = 9999;
|
int min = 9999;
|
||||||
if (x.size() > 0) {
|
if (x.size() > 0) { // at least one lap is available
|
||||||
if (x.at(0).size() >= 3) {
|
|
||||||
if (getCurTime(x.at(0)) >= minTrackTime &&
|
for(auto vec : x){
|
||||||
x.at(0).at(0) > QVectorHelper::minSec1 &&
|
if (vec.size() >= 3) { // check if 3 sectors are available
|
||||||
x.at(0).at(1) > QVectorHelper::minSec2 &&
|
if (getCurTime(x.at(0)) >= minTrackTime &&
|
||||||
x.at(0).at(2) > QVectorHelper::minSec3) {
|
vec.at(0) > QVectorHelper::minSec1 &&
|
||||||
min = getCurTime(x.at(0));
|
vec.at(1) > QVectorHelper::minSec2 &&
|
||||||
|
vec.at(2) > QVectorHelper::minSec3) { // check if lap is valid
|
||||||
|
min = getCurTime(vec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
return 9999;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return 9999;
|
return 9999;
|
||||||
|
|||||||
Reference in New Issue
Block a user