Merge branch 'fix_initial_player_landing' into 'master'

Trace down player on initial cell loading after all cells are loaded (#6907)

Closes #6907

See merge request OpenMW/openmw!2206
check_span
Alexei Kotov 2 years ago
commit 1e7cbb88d2

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

Loading…
Cancel
Save