1
0
Fork 0

ALERT and not SIGSEGV when no local scenery

This commit is contained in:
portree_kid 2021-03-08 21:54:01 +01:00 committed by James Turner
parent 009d86e7a6
commit fb5848896e

View file

@ -40,13 +40,17 @@ double FGTaxiNode::getElevationFt()
FGScenery* local_scenery = globals->get_scenery();
center2.setElevationM(SG_MAX_ELEVATION_M);
double elevationEnd = -100;
if (local_scenery->get_elevation_m( center2, elevationEnd, NULL ))
{
SGGeod newPos = pos;
newPos.setElevationM(elevationEnd);
// this will call modifyPosition to update mPosition
modifyPosition(newPos);
}
if(local_scenery) {
if (local_scenery->get_elevation_m( center2, elevationEnd, NULL ))
{
SGGeod newPos = pos;
newPos.setElevationM(elevationEnd);
// this will call modifyPosition to update mPosition
modifyPosition(newPos);
}
} else {
SG_LOG( SG_TERRAIN, SG_ALERT, "Terrain not inited" );
}
}
return pos.getElevationFt();