From 4c96278bb4c496cc939f44a30dbc9c6cfcabc5ec Mon Sep 17 00:00:00 2001 From: commy2 Date: Thu, 6 Oct 2016 10:59:21 +0200 Subject: [PATCH] fix fatigue when diving while sprinting, fix #4481 --- addons/advanced_fatigue/functions/fnc_mainLoop.sqf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/addons/advanced_fatigue/functions/fnc_mainLoop.sqf b/addons/advanced_fatigue/functions/fnc_mainLoop.sqf index 6430643cac..f438d6ef08 100644 --- a/addons/advanced_fatigue/functions/fnc_mainLoop.sqf +++ b/addons/advanced_fatigue/functions/fnc_mainLoop.sqf @@ -15,6 +15,12 @@ if (!alive ACE_player) exitWith { // Dead people don't breath, Will also handle private _currentWork = REE; private _currentSpeed = (vectorMagnitude (velocity ACE_player)) min 6; + +// fix #4481. Diving to the ground is recorded as PRONE stance with running speed velocity. Cap maximum speed to fix. +if (stance ACE_player == "PRONE") then { + _currentSpeed = _currentSpeed min 1.5; +}; + if ((vehicle ACE_player == ACE_player) && {_currentSpeed > 0.1} && {isTouchingGround ACE_player || {underwater ACE_player}}) then { _currentWork = [ACE_player, _currentSpeed] call FUNC(getMetabolicCosts); _currentWork = _currentWork max REE;