From 458c0bba416a070dcf9e70b400cba2e448846828 Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Sun, 5 May 2019 14:02:14 +0300 Subject: [PATCH] Avoid using null pointer for player's cell in moveObjectImp --- apps/openmw/mwworld/worldimp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index cd03137d7..0199457a9 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -1306,7 +1306,7 @@ namespace MWWorld CellStore* cell = ptr.getCell(); CellStore* newCell = getExterior(cellX, cellY); - bool isCellActive = getPlayerPtr().getCell()->isExterior() && mWorldScene->isCellActive(*newCell); + bool isCellActive = getPlayerPtr().isInCell() && getPlayerPtr().getCell()->isExterior() && mWorldScene->isCellActive(*newCell); if (cell->isExterior() || (moveToActive && isCellActive && ptr.getClass().isActor())) cell = newCell;