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:
parent
d649c19790
commit
09f27d142a
@ -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
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user