There was a null pointer exception when finishing the race, as the finish leg doesn't have compound marks.
This commit is contained in:
@@ -429,6 +429,7 @@ public class RaceViewController extends Controller {
|
|||||||
@Override
|
@Override
|
||||||
public void handle(long now) {
|
public void handle(long now) {
|
||||||
CompoundMark target = boat.getCurrentLeg().getEndCompoundMark();
|
CompoundMark target = boat.getCurrentLeg().getEndCompoundMark();
|
||||||
|
if (target != null) {
|
||||||
Bearing headingToMark = GPSCoordinate.calculateBearing(boat.getPosition(), target.getAverageGPSCoordinate());
|
Bearing headingToMark = GPSCoordinate.calculateBearing(boat.getPosition(), target.getAverageGPSCoordinate());
|
||||||
|
|
||||||
nextMarkArrow.setX(view3D.getPivot().getX());
|
nextMarkArrow.setX(view3D.getPivot().getX());
|
||||||
@@ -436,6 +437,7 @@ public class RaceViewController extends Controller {
|
|||||||
nextMarkArrow.setZ(view3D.getPivot().getZ() + 15);
|
nextMarkArrow.setZ(view3D.getPivot().getZ() + 15);
|
||||||
nextMarkArrow.setHeading(headingToMark.degrees());
|
nextMarkArrow.setHeading(headingToMark.degrees());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
arrowToNextMark.start();
|
arrowToNextMark.start();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user