mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-19 20:53:52 +00:00
Partially revert !1046: the player is added before the scene exists, so we need to check again the grounded state, as it correctly was.
This commit is contained in:
parent
640998aca0
commit
713f612bdb
2 changed files with 6 additions and 3 deletions
|
@ -712,9 +712,6 @@ namespace MWPhysics
|
|||
|
||||
auto actor = std::make_shared<Actor>(ptr, shape, mTaskScheduler.get(), canWaterWalk);
|
||||
|
||||
// check if Actor is on the ground or in the air
|
||||
traceDown(ptr, ptr.getRefData().getPosition().asVec3(), 10.f);
|
||||
|
||||
mActors.emplace(ptr, std::move(actor));
|
||||
}
|
||||
|
||||
|
|
|
@ -504,6 +504,12 @@ namespace MWWorld
|
|||
|
||||
const auto player = MWBase::Environment::get().getWorld()->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(player.getRefData().getPosition().asVec3());
|
||||
|
||||
if (!cell->isExterior() && !(cell->getCell()->mData.mFlags & ESM::Cell::QuasiEx))
|
||||
|
|
Loading…
Reference in a new issue