From: curt Date: Wed, 9 Oct 2002 14:29:42 +0000 (+0000) Subject: Fix a potential crash with William Riley's scenery build. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=83314d3f4541cd554d39959e5bd792ec0164f4d0;p=flightgear.git Fix a potential crash with William Riley's scenery build. --- diff --git a/src/Objects/matlib.cxx b/src/Objects/matlib.cxx index 346d5c9a5..342918bd4 100644 --- a/src/Objects/matlib.cxx +++ b/src/Objects/matlib.cxx @@ -252,6 +252,7 @@ bool FGMaterialLib::load( const string& mpath ) { matlib["RWY_WHITE_LIGHTS"] = new FGNewMat(rwy_white_lights); // For backwards compatibility ... remove someday matlib["RUNWAY_LIGHTS"] = new FGNewMat(rwy_white_lights); + matlib["RWY_LIGHTS"] = new FGNewMat(rwy_white_lights); // end of backwards compatitibilty // hard coded runway vasi light state diff --git a/src/Objects/pt_lights.cxx b/src/Objects/pt_lights.cxx index 366a1381e..7f2f03341 100644 --- a/src/Objects/pt_lights.cxx +++ b/src/Objects/pt_lights.cxx @@ -101,8 +101,13 @@ ssgLeaf *gen_directional_light( sgVec3 pt, sgVec3 dir, sgVec3 up, new ssgVtxTable ( GL_TRIANGLES, vl, nl, NULL, cl ); FGNewMat *newmat = material_lib.find( material ); - // FGNewMat *newmat = material_lib.find( "IrrCropPastureCover" ); - leaf->setState( newmat->get_state() ); + + if ( newmat != NULL ) { + leaf->setState( newmat->get_state() ); + } else { + SG_LOG( SG_TERRAIN, SG_ALERT, "Warning: can't material = " + << material ); + } return leaf; } diff --git a/src/Scenery/tileentry.cxx b/src/Scenery/tileentry.cxx index fca86633b..59e909d2c 100644 --- a/src/Scenery/tileentry.cxx +++ b/src/Scenery/tileentry.cxx @@ -1348,7 +1348,7 @@ FGTileEntry::load( const SGPath& base, bool is_base ) // Add runway lights to scene graph if any exist if ( rwy_lights_range->getNumKids() > 0 ) { - SG_LOG( SG_TERRAIN, SG_INFO, "adding runway lights" ); + SG_LOG( SG_TERRAIN, SG_DEBUG, "adding runway lights" ); rwy_lights_transform->addKid( rwy_lights_range ); rwy_lights_transform->setTransform( &sgcoord ); }