1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 07:53:53 +00:00

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
This commit is contained in:
Alexei Kotov 2022-07-29 23:45:10 +00:00
commit 1e7cbb88d2

View file

@ -459,14 +459,6 @@ namespace MWWorld
else else
mPhysics->disableWater(); 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); mNavigator.update(position);
if (!cell->isExterior() && !(cell->getCell()->mData.mFlags & ESM::Cell::QuasiEx)) if (!cell->isExterior() && !(cell->getCell()->mData.mFlags & ESM::Cell::QuasiEx))
@ -746,6 +738,11 @@ namespace MWWorld
MWWorld::Ptr player = mWorld.getPlayerPtr(); MWWorld::Ptr player = mWorld.getPlayerPtr();
mRendering.updatePlayerPtr(player); 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) if (adjustPlayerPos)
{ {
mWorld.moveObject(player, pos.asVec3()); mWorld.moveObject(player, pos.asVec3());