1
0
Fork 0

Fix uninitialized variable valgrind warning

This commit is contained in:
Stuart Buchanan 2022-10-11 22:08:29 +01:00
parent 86f82994be
commit 64ae52438b

View file

@ -365,11 +365,12 @@ bool FGStgTerrain::scenery_available(const SGGeod& position, double range_m)
{ {
if( schedule_scenery(position, range_m, 0.0) ) if( schedule_scenery(position, range_m, 0.0) )
{ {
double elev; double elev = 0.0;
bool use_vpb = globals->get_props()->getNode("scenery/use-vpb")->getBoolValue(); bool use_vpb = globals->get_props()->getNode("scenery/use-vpb")->getBoolValue();
bool got_elev = get_elevation_m(SGGeod::fromGeodM(position, SG_MAX_ELEVATION_M), elev, 0, 0);
if (!use_vpb && !get_elevation_m(SGGeod::fromGeodM(position, SG_MAX_ELEVATION_M), elev, 0, 0)) if (!use_vpb && !got_elev)
{ {
SG_LOG(SG_TERRAIN, SG_DEBUG, "FGStgTerrain::scenery_available - false" ); SG_LOG(SG_TERRAIN, SG_DEBUG, "FGStgTerrain::scenery_available - false" );
return false; return false;