From 0bbcc0e787a12fd5ec3dfc940b503ca814eab57c Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Sun, 23 Dec 2018 13:39:35 +0300 Subject: [PATCH] Avoid falling height reset if onGround state didn't change (bug #4411) --- CHANGELOG.md | 1 + apps/openmw/mwphysics/physicssystem.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1256da340..190ba3692 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ Bug #2987: Editor: some chance and AI data fields can overflow Bug #3623: Fix HiDPI on Windows + Bug #4411: Reloading a saved game while falling prevents damage in some cases Bug #4540: Rain delay when exiting water Bug #4701: PrisonMarker record is not hardcoded like other markers Bug #4714: Crash upon game load in the repair menu while the "Your repair failed!" message is active diff --git a/apps/openmw/mwphysics/physicssystem.cpp b/apps/openmw/mwphysics/physicssystem.cpp index 836370255..a4fd2c1ca 100644 --- a/apps/openmw/mwphysics/physicssystem.cpp +++ b/apps/openmw/mwphysics/physicssystem.cpp @@ -1339,7 +1339,7 @@ namespace MWPhysics float heightDiff = position.z() - oldHeight; MWMechanics::CreatureStats& stats = iter->first.getClass().getCreatureStats(iter->first); - if ((wasOnGround && physicActor->getOnGround()) || flying || world->isSwimming(iter->first) || slowFall < 1) + if ((numSteps > 0 && wasOnGround && physicActor->getOnGround()) || flying || world->isSwimming(iter->first) || slowFall < 1) stats.land(iter->first == player); else if (heightDiff < 0) stats.addToFallHeight(-heightDiff);