|
|
|
|
@ -319,9 +319,9 @@ public class MockRace extends Race {
|
|
|
|
|
//Checks if the current boat has finished the race or not.
|
|
|
|
|
boolean finish = this.isLastLeg(boat.getCurrentLeg());
|
|
|
|
|
|
|
|
|
|
if (!finish && totalElapsedMilliseconds >= updatePeriodMilliseconds) {
|
|
|
|
|
if (!finish && totalElapsedMilliseconds >= updatePeriodMilliseconds && !boat.isSailsOut()) {
|
|
|
|
|
|
|
|
|
|
if (boat.getCurrentSpeed() == 0 && !boat.isSailsOut()) {
|
|
|
|
|
if (boat.getCurrentSpeed() == 0) {
|
|
|
|
|
newOptimalVMG(boat);
|
|
|
|
|
boat.setBearing(boat.calculateBearingToNextMarker());
|
|
|
|
|
}
|
|
|
|
|
@ -342,10 +342,12 @@ public class MockRace extends Race {
|
|
|
|
|
if (boat.isAutoVMG()) {
|
|
|
|
|
newOptimalVMG(boat);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.updateEstimatedTime(boat);
|
|
|
|
|
} else {
|
|
|
|
|
boat.setCurrentSpeed(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.updateEstimatedTime(boat);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void newOptimalVMG(MockBoat boat) {
|
|
|
|
|
|