From 97c6d25d541c1167df884a8945e2d7f231fc492c Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Mon, 6 Feb 2023 16:36:45 +0100 Subject: [PATCH] Use correct exterior cell when positioning --- apps/openmw/mwscript/transformationextensions.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/openmw/mwscript/transformationextensions.cpp b/apps/openmw/mwscript/transformationextensions.cpp index 83a3c0ef0c..c624d24753 100644 --- a/apps/openmw/mwscript/transformationextensions.cpp +++ b/apps/openmw/mwscript/transformationextensions.cpp @@ -400,6 +400,11 @@ namespace MWScript try { store = worldModel->getCell(cellID); + if (store->isExterior()) + { + const osg::Vec2i cellIndex = MWWorld::positionToCellIndex(x, y); + store = worldModel->getExterior(cellIndex.x(), cellIndex.y()); + } } catch (std::exception&) {