mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-20 19:39:41 +00:00
Merge pull request #2115 from Capostrophic/slowfall
Don't reset player jumping flag unnecessarily (bug #4775)
This commit is contained in:
commit
de24682e2f
2 changed files with 5 additions and 2 deletions
|
@ -15,6 +15,7 @@
|
|||
Bug #4746: Non-solid player can't run or sneak
|
||||
Bug #4750: Sneaking doesn't work in first person view if the player is in attack ready state
|
||||
Bug #4768: Fallback numerical value recovery chokes on invalid arguments
|
||||
Bug #4775: Slowfall effect resets player jumping flag
|
||||
Bug #4778: Interiors of Illusion puzzle in Sotha Sil Expanded mod is broken
|
||||
Feature #2229: Improve pathfinding AI
|
||||
Feature #3442: Default values for fallbacks from ini file
|
||||
|
|
|
@ -1317,6 +1317,7 @@ namespace MWPhysics
|
|||
float slowFall = 1.f - std::max(0.f, std::min(1.f, effects.get(ESM::MagicEffect::SlowFall).getMagnitude() * 0.005f));
|
||||
|
||||
bool flying = world->isFlying(iter->first);
|
||||
bool swimming = world->isSwimming(iter->first);
|
||||
|
||||
bool wasOnGround = physicActor->getOnGround();
|
||||
osg::Vec3f position = physicActor->getPosition();
|
||||
|
@ -1339,8 +1340,9 @@ namespace MWPhysics
|
|||
float heightDiff = position.z() - oldHeight;
|
||||
|
||||
MWMechanics::CreatureStats& stats = iter->first.getClass().getCreatureStats(iter->first);
|
||||
if ((numSteps > 0 && wasOnGround && physicActor->getOnGround()) || flying || world->isSwimming(iter->first) || slowFall < 1)
|
||||
stats.land(iter->first == player);
|
||||
bool isStillOnGround = (numSteps > 0 && wasOnGround && physicActor->getOnGround());
|
||||
if (isStillOnGround || flying || swimming || slowFall < 1)
|
||||
stats.land(iter->first == player && (flying || swimming));
|
||||
else if (heightDiff < 0)
|
||||
stats.addToFallHeight(-heightDiff);
|
||||
|
||||
|
|
Loading…
Reference in a new issue