diff --git a/src/osgPlugins/OpenFlight/expGeometryRecords.cpp b/src/osgPlugins/OpenFlight/expGeometryRecords.cpp index 4a65cc0ed..9907d7734 100644 --- a/src/osgPlugins/OpenFlight/expGeometryRecords.cpp +++ b/src/osgPlugins/OpenFlight/expGeometryRecords.cpp @@ -67,7 +67,7 @@ FltExportVisitor::isTextured( int unit, const osg::Geometry& geom ) const bool texOn( ss->getTextureMode( unit, GL_TEXTURE_2D ) & osg::StateAttribute::ON ); #else // In this mode, osg::Texture::getModeUsage() is undefined, so just detect if a texture is present - bool texOn = (ss->getTextureAttribute(0, osg::StateAttribute::TEXTURE) != NULL); + bool texOn( ss->getTextureAttribute( unit, osg::StateAttribute::TEXTURE ) != NULL ); #endif bool hasCoords( geom.getTexCoordArray( unit ) != NULL );