From 6dc3d8b44b3c363a75f0d95764a2a9880df921e0 Mon Sep 17 00:00:00 2001 From: Nelsson Huotari Date: Thu, 9 May 2019 21:34:14 +0300 Subject: [PATCH] More readable code --- apps/opencs/view/render/terraintexturemode.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/apps/opencs/view/render/terraintexturemode.cpp b/apps/opencs/view/render/terraintexturemode.cpp index 08a437b37..468574c03 100644 --- a/apps/opencs/view/render/terraintexturemode.cpp +++ b/apps/opencs/view/render/terraintexturemode.cpp @@ -496,12 +496,9 @@ bool CSVRender::TerrainTextureMode::isInCellSelection(int globalSelectionX, int { if (CSVRender::PagedWorldspaceWidget *paged = dynamic_cast (&getWorldspaceWidget())) { - CSMWorld::CellSelection selection = paged->getCellSelection(); - if (selection.has (CSMWorld::CellCoordinates::fromId( - CSMWorld::CellCoordinates::textureGlobalToCellId(std::make_pair(globalSelectionX, globalSelectionY))).first)) - { - return true; - } + std::pair textureCoords = std::make_pair(globalSelectionX, globalSelectionY); + std::string cellId = CSMWorld::CellCoordinates::textureGlobalToCellId(textureCoords); + return paged->getCellSelection().has(CSMWorld::CellCoordinates::fromId(cellId).first); } return false; }