1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-05 15:55:45 +00:00

Clear movement queue when changing to a new cell (Fixes #1802)

This commit is contained in:
scrawl 2014-08-13 16:23:34 +02:00
parent d649c19790
commit 09f27d142a
3 changed files with 15 additions and 0 deletions

View File

@ -784,6 +784,13 @@ namespace MWWorld
mMovementQueue.push_back(std::make_pair(ptr, movement));
}
void PhysicsSystem::clearQueuedMovement()
{
mMovementQueue.clear();
mCollisions.clear();
mStandingCollisions.clear();
}
const PtrVelocityList& PhysicsSystem::applyQueuedMovement(float dt)
{
// Collision events are only tracked for a single frame, so reset first

View File

@ -85,8 +85,12 @@ namespace MWWorld
/// be overwritten. Valid until the next call to applyQueuedMovement.
void queueObjectMovement(const Ptr &ptr, const Ogre::Vector3 &velocity);
/// Apply all queued movements, then clear the list.
const PtrVelocityList& applyQueuedMovement(float dt);
/// Clear the queued movements list without applying.
void clearQueuedMovement();
/// Return true if \a actor has been standing on \a object in this frame
/// This will trigger whenever the object is directly below the actor.
/// It doesn't matter if the actor is stationary or moving.

View File

@ -840,6 +840,8 @@ namespace MWWorld
void World::changeToInteriorCell (const std::string& cellName, const ESM::Position& position)
{
mPhysics->clearQueuedMovement();
if (mCurrentWorldSpace != cellName)
{
// changed worldspace
@ -855,6 +857,8 @@ namespace MWWorld
void World::changeToExteriorCell (const ESM::Position& position)
{
mPhysics->clearQueuedMovement();
if (mCurrentWorldSpace != "sys::default") // FIXME
{
// changed worldspace