mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-01 00:45:32 +00:00
Merge branch 'standing' into 'master'
Fix standing actors logic See merge request OpenMW/openmw!360
This commit is contained in:
commit
7f59751946
2 changed files with 9 additions and 4 deletions
|
@ -678,10 +678,10 @@ namespace MWPhysics
|
||||||
|
|
||||||
mTimeAccum -= numSteps * mPhysicsDt;
|
mTimeAccum -= numSteps * mPhysicsDt;
|
||||||
|
|
||||||
return mTaskScheduler->moveActors(numSteps, mTimeAccum, prepareFrameData(), mStandingCollisions, skipSimulation);
|
return mTaskScheduler->moveActors(numSteps, mTimeAccum, prepareFrameData(numSteps), mStandingCollisions, skipSimulation);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<ActorFrameData> PhysicsSystem::prepareFrameData()
|
std::vector<ActorFrameData> PhysicsSystem::prepareFrameData(int numSteps)
|
||||||
{
|
{
|
||||||
std::vector<ActorFrameData> actorsFrameData;
|
std::vector<ActorFrameData> actorsFrameData;
|
||||||
actorsFrameData.reserve(mMovementQueue.size());
|
actorsFrameData.reserve(mMovementQueue.size());
|
||||||
|
@ -723,7 +723,12 @@ namespace MWPhysics
|
||||||
// Slow fall reduces fall speed by a factor of (effect magnitude / 200)
|
// Slow fall reduces fall speed by a factor of (effect magnitude / 200)
|
||||||
const float slowFall = 1.f - std::max(0.f, std::min(1.f, effects.get(ESM::MagicEffect::SlowFall).getMagnitude() * 0.005f));
|
const float slowFall = 1.f - std::max(0.f, std::min(1.f, effects.get(ESM::MagicEffect::SlowFall).getMagnitude() * 0.005f));
|
||||||
|
|
||||||
actorsFrameData.emplace_back(std::move(physicActor), character, mStandingCollisions[character], moveToWaterSurface, movement, slowFall, waterlevel);
|
// Ue current value only if we don't advance the simulation. Otherwise we might get a stale value.
|
||||||
|
MWWorld::Ptr standingOn;
|
||||||
|
if (numSteps == 0)
|
||||||
|
standingOn = mStandingCollisions[character];
|
||||||
|
|
||||||
|
actorsFrameData.emplace_back(std::move(physicActor), character, standingOn, moveToWaterSurface, movement, slowFall, waterlevel);
|
||||||
}
|
}
|
||||||
mMovementQueue.clear();
|
mMovementQueue.clear();
|
||||||
return actorsFrameData;
|
return actorsFrameData;
|
||||||
|
|
|
@ -237,7 +237,7 @@ namespace MWPhysics
|
||||||
|
|
||||||
void updateWater();
|
void updateWater();
|
||||||
|
|
||||||
std::vector<ActorFrameData> prepareFrameData();
|
std::vector<ActorFrameData> prepareFrameData(int numSteps);
|
||||||
|
|
||||||
osg::ref_ptr<SceneUtil::UnrefQueue> mUnrefQueue;
|
osg::ref_ptr<SceneUtil::UnrefQueue> mUnrefQueue;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue