diff --git a/components/esm3terrain/storage.cpp b/components/esm3terrain/storage.cpp index dc68fccf92..df90f2d4ca 100644 --- a/components/esm3terrain/storage.cpp +++ b/components/esm3terrain/storage.cpp @@ -194,7 +194,7 @@ namespace ESMTerrain int startCellX = static_cast(std::floor(origin.x())); int startCellY = static_cast(std::floor(origin.y())); const int landSize = ESM::getLandSize(worldspace); - const int LandSizeInUnits = ESM::getCellSize(worldspace); + const int landSizeInUnits = ESM::getCellSize(worldspace); size_t numVerts = static_cast(size * (landSize - 1) / increment + 1); @@ -268,9 +268,10 @@ namespace ESMTerrain height = heightData->getHeights()[col * landSize + row]; if (alteration) height += getAlteredHeight(col, row); + positions[static_cast(vertX * numVerts + vertY)] - = osg::Vec3f((vertX / float(numVerts - 1) - 0.5f) * size * LandSizeInUnits, - (vertY / float(numVerts - 1) - 0.5f) * size * LandSizeInUnits, height); + = osg::Vec3f((vertX / float(numVerts - 1) - 0.5f) * size * landSizeInUnits, + (vertY / float(numVerts - 1) - 0.5f) * size * landSizeInUnits, height); if (normalData) {