From ac5b356e8da64e4a0e60b2e327fd3425d234c57b Mon Sep 17 00:00:00 2001 From: Nelsson Huotari Date: Wed, 23 Oct 2019 00:01:23 +0300 Subject: [PATCH] Always initialize landShapeNew --- apps/opencs/view/render/terrainshapemode.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/apps/opencs/view/render/terrainshapemode.cpp b/apps/opencs/view/render/terrainshapemode.cpp index 559b8a47c2..bc0a2650f8 100644 --- a/apps/opencs/view/render/terrainshapemode.cpp +++ b/apps/opencs/view/render/terrainshapemode.cpp @@ -310,13 +310,10 @@ void CSVRender::TerrainShapeMode::applyTerrainEditChanges() { for(int j = 0; j < ESM::Land::LAND_SIZE; ++j) { - if (paged) - { - if (paged->getCellAlteredHeight(cellCoordinates, i, j)) - landShapeNew[j * ESM::Land::LAND_SIZE + i] = landShapePointer[j * ESM::Land::LAND_SIZE + i] + *paged->getCellAlteredHeight(cellCoordinates, i, j); - else - landShapeNew[j * ESM::Land::LAND_SIZE + i] = 0; - } + if (paged && paged->getCellAlteredHeight(cellCoordinates, i, j)) + landShapeNew[j * ESM::Land::LAND_SIZE + i] = landShapePointer[j * ESM::Land::LAND_SIZE + i] + *paged->getCellAlteredHeight(cellCoordinates, i, j); + else + landShapeNew[j * ESM::Land::LAND_SIZE + i] = 0; } }