From 37b0ff596ce2c93fbc494887aeb52a2a05ad9405 Mon Sep 17 00:00:00 2001 From: elsid Date: Fri, 29 Jul 2022 23:16:21 +0200 Subject: [PATCH] Trace down player on initial cell loading after all cells are loaded --- apps/openmw/mwworld/scene.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/apps/openmw/mwworld/scene.cpp b/apps/openmw/mwworld/scene.cpp index f23c086827..01ac40223f 100644 --- a/apps/openmw/mwworld/scene.cpp +++ b/apps/openmw/mwworld/scene.cpp @@ -459,14 +459,6 @@ namespace MWWorld else mPhysics->disableWater(); - const auto player = mWorld.getPlayerPtr(); - - // The player is loaded before the scene and by default it is grounded, with the scene fully loaded, we validate and correct this. - if (player.mCell == cell) // Only run once, during initial cell load. - { - mPhysics->traceDown(player, player.getRefData().getPosition().asVec3(), 10.f); - } - mNavigator.update(position); if (!cell->isExterior() && !(cell->getCell()->mData.mFlags & ESM::Cell::QuasiEx)) @@ -746,6 +738,11 @@ namespace MWWorld MWWorld::Ptr player = mWorld.getPlayerPtr(); mRendering.updatePlayerPtr(player); + // The player is loaded before the scene and by default it is grounded, with the scene fully loaded, + // we validate and correct this. Only run once, during initial cell load. + if (old.mCell == cell) + mPhysics->traceDown(player, player.getRefData().getPosition().asVec3(), 10.f); + if (adjustPlayerPos) { mWorld.moveObject(player, pos.asVec3());