From 59da0a0da99e0640303df2c674408b7c0ef18aef Mon Sep 17 00:00:00 2001 From: psi29a Date: Fri, 16 Jul 2021 07:50:26 +0000 Subject: [PATCH] Merge branch 'skip_async' into 'master' Don't put player in the air after going out of tcl See merge request OpenMW/openmw!1009 (cherry picked from commit 6d08a1d7318ae076839738d173b884fcc7b1a348) 6ad2cf8e Skip simulation result after calling Actor::updatePosition(). Otherwise --- apps/openmw/mwphysics/actor.cpp | 4 +++- apps/openmw/mwphysics/actor.hpp | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwphysics/actor.cpp b/apps/openmw/mwphysics/actor.cpp index f0bc23413..66c0208d8 100644 --- a/apps/openmw/mwphysics/actor.cpp +++ b/apps/openmw/mwphysics/actor.cpp @@ -124,11 +124,13 @@ void Actor::updatePosition() mPositionOffset = osg::Vec3f(); mStandingOnPtr = nullptr; mSkipCollisions = true; + mSkipSimulation = true; } void Actor::setSimulationPosition(const osg::Vec3f& position) { - mSimulationPosition = position; + if (!std::exchange(mSkipSimulation, false)) + mSimulationPosition = position; } osg::Vec3f Actor::getSimulationPosition() const diff --git a/apps/openmw/mwphysics/actor.hpp b/apps/openmw/mwphysics/actor.hpp index 7b53e8812..6859022d4 100644 --- a/apps/openmw/mwphysics/actor.hpp +++ b/apps/openmw/mwphysics/actor.hpp @@ -204,6 +204,7 @@ namespace MWPhysics osg::Vec3f mVelocity; bool mWorldPositionChanged; bool mSkipCollisions; + bool mSkipSimulation; btTransform mLocalTransform; mutable std::mutex mPositionMutex;