From 6b49ce965b0632709aa753f89c36585a12236a25 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Sun, 14 Apr 2019 18:09:11 +0400 Subject: [PATCH] Do not update drowning state for actors outside of AI distance (bug #4980) --- CHANGELOG.md | 1 + apps/openmw/mwmechanics/actors.cpp | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f938c00ad..13c25ca1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -62,6 +62,7 @@ Bug #4969: "Miss" sound plays for any actor Bug #4972: Player is able to use quickkeys while disableplayerfighting is active Bug #4979: AiTravel maximum range depends on "actors processing range" setting + Bug #4980: Drowning mechanics is applied for actors indifferently from distance to player Feature #2229: Improve pathfinding AI Feature #3442: Default values for fallbacks from ini file Feature #3610: Option to invert X axis diff --git a/apps/openmw/mwmechanics/actors.cpp b/apps/openmw/mwmechanics/actors.cpp index b627bdafa..bf515c842 100644 --- a/apps/openmw/mwmechanics/actors.cpp +++ b/apps/openmw/mwmechanics/actors.cpp @@ -1539,7 +1539,10 @@ namespace MWMechanics if(iter->first.getClass().isNpc()) { - updateDrowning(iter->first, duration, ctrl->isKnockedOut(), isPlayer); + // We can not update drowning state for actors outside of AI distance - they can not resurface to breathe + if (inProcessingRange) + updateDrowning(iter->first, duration, ctrl->isKnockedOut(), isPlayer); + calculateNpcStatModifiers(iter->first, duration); if (timerUpdateEquippedLight == 0)