1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-08 09:37:53 +00:00

Merge branch 'reallyskipphysics' into 'master'

Close race that breaks scripted teleporting (#5873)

See merge request OpenMW/openmw!639
This commit is contained in:
Alexei Dobrohotov 2021-03-07 08:41:20 +00:00
commit e9aa161ffc

View File

@ -174,6 +174,9 @@ osg::Vec3f Actor::getCollisionObjectPosition() const
bool Actor::setPosition(const osg::Vec3f& position)
{
std::scoped_lock lock(mPositionMutex);
// position is being forced, ignore simulation results until we sync up
if (mSkipSimulation)
return false;
bool hasChanged = mPosition != position || mPositionOffset.length() != 0 || mWorldPositionChanged;
mPreviousPosition = mPosition + mPositionOffset;
mPosition = position + mPositionOffset;