avoid reducing windward distance traveled in case a competitor is at the mark rounding and has a negative windward distance traveled for the current leg

This commit is contained in:
Axel Uhl committed 2015-05-20 18:03:58 +02:00
1 parent 2d11ab9a31
commit 9bc3fddebc
1 file changed
+5 -1
@@ -533,7 +533,11 @@ public abstract class AbstractRankingMetric implements RankingMetric {
if (legWindwardDistance.compareTo(windwardDistanceFromLegStart) < 0) {
d = d.add(legWindwardDistance);
} else {
d = d.add(windwardDistanceFromLegStart);
// if the competitor is currently at the mark rounding, the windward distance within the leg may
// be negative; don't reduce the distance in this case
if (windwardDistanceFromLegStart.getMeters() > 0) {
d = d.add(windwardDistanceFromLegStart);
}
}
break;
} else {