mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-28 17:56:37 +00:00 
			
		
		
		
	Use saved actor position instead of reading again RefData in unstuck. It
is a race condition to do so.
This commit is contained in:
		
							parent
							
								
									5fce5b12f4
								
							
						
					
					
						commit
						ccd3cbc69a
					
				
					 1 changed files with 1 additions and 2 deletions
				
			
		|  | @ -459,8 +459,7 @@ namespace MWPhysics | |||
|         const auto verticalHalfExtent = osg::Vec3f(0.0, 0.0, physicActor->getHalfExtents().z()); | ||||
| 
 | ||||
|         // use a 3d approximation of the movement vector to better judge player intent
 | ||||
|         const ESM::Position& refpos = ptr.getRefData().getPosition(); | ||||
|         auto velocity = (osg::Quat(refpos.rot[0], osg::Vec3f(-1, 0, 0)) * osg::Quat(refpos.rot[2], osg::Vec3f(0, 0, -1))) * actor.mMovement; | ||||
|         auto velocity = (osg::Quat(actor.mRefpos.rot[0], osg::Vec3f(-1, 0, 0)) * osg::Quat(actor.mRefpos.rot[2], osg::Vec3f(0, 0, -1))) * actor.mMovement; | ||||
|         // try to pop outside of the world before doing anything else if we're inside of it
 | ||||
|         if (!physicActor->getOnGround() || physicActor->getOnSlope()) | ||||
|                 velocity += physicActor->getInertialForce(); | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue