ACE3/addons/common/functions/fnc_swayLoop.sqf
johnb432 80417b114d
Advanced Fatigue - Move sway to common and add enable sway setting (#9872)
* Move sway from fatigue to common

* Added enable sway setting

* Update addons/common/stringtable.xml

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>

* Update addons/common/stringtable.xml

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>

* Update addons/common/stringtable.xml

---------

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
2024-03-24 14:28:14 -07:00

31 lines
754 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: LinkIsGrim
* Calculates and applies final sway coefficient from sway factors
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* call ace_common_fnc_swayLoop
*
* Public: No
*/
private _baseline = 1;
if (GVAR(swayFactorsBaseline) isNotEqualTo []) then {
_baseline = 1 max ([missionNamespace, "ACE_setCustomAimCoef_baseline", "max"] call FUNC(arithmeticGetResult));
};
private _multiplier = 1;
if (GVAR(swayFactorsMultiplier) isNotEqualTo []) then {
_multiplier = [missionNamespace, "ACE_setCustomAimCoef_multiplier", "product"] call FUNC(arithmeticGetResult);
};
ACE_player setCustomAimCoef (_baseline * _multiplier);
[FUNC(swayLoop), [], 0.5] call CBA_fnc_waitAndExecute