Merge pull request #2368 from Capostrophic/teleport

Avoid using null pointer for player's cell in moveObjectImp
pull/541/head
Andrei Kortunov 6 years ago committed by GitHub
commit 30ea2a2063
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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;

Loading…
Cancel
Save