From aae74224e8cebb590e9f31b99225453d0f10934a Mon Sep 17 00:00:00 2001 From: Alexei Kotov Date: Fri, 16 Feb 2024 14:28:43 +0300 Subject: [PATCH] Prevent swim upward correction from causing false-positive jumping events (#7833) --- apps/openmw/mwmechanics/character.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index 49221cbae9..d1f41ad514 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -2146,7 +2146,12 @@ namespace MWMechanics mInJump = false; const float jumpHeight = cls.getJump(mPtr); if (jumpHeight <= 0.f || sneak || inwater || flying || !solid) + { vec.z() = 0.f; + // Following code might assign some vertical movement regardless, need to reset this manually + // This is used for jumping detection + movementSettings.mPosition[2] = 0; + } if (!inwater && !flying && solid) {