From 06af4cb56a06662ebc522771617779f53fa9a78d Mon Sep 17 00:00:00 2001 From: elsid Date: Sun, 28 May 2023 14:25:44 +0200 Subject: [PATCH] Use sDefaultWorldspaceId as fallback worldspace for PositionCell command store is nullptr at this point because there was no cell found. --- apps/openmw/mwscript/transformationextensions.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwscript/transformationextensions.cpp b/apps/openmw/mwscript/transformationextensions.cpp index 879cf85144..a8d7dc0871 100644 --- a/apps/openmw/mwscript/transformationextensions.cpp +++ b/apps/openmw/mwscript/transformationextensions.cpp @@ -417,9 +417,8 @@ namespace MWScript Log(Debug::Warning) << error; if (!isPlayer) return; - const ESM::ExteriorCellLocation cellIndex - = ESM::positionToExteriorCellLocation(x, y, store->getCell()->getWorldSpace()); - store = &worldModel->getExterior(cellIndex); + store = &worldModel->getExterior( + ESM::positionToExteriorCellLocation(x, y, ESM::Cell::sDefaultWorldspaceId)); } if (store) {