Advanced Fatigue - Disable sway when Advanced Fatigue is off (#9867)

Disabled sway when advanced fatigue is off
This commit is contained in:
johnb432 2024-03-21 20:24:49 +01:00 committed by GitHub
parent af3c95a5a6
commit b4eaa1e270
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,7 +2,15 @@
if (!hasInterface) exitWith {};
["baseline", {
// recheck weapon inertia after weapon swap, change of attachments or switching unit
["weapon", {[ACE_player] call FUNC(getWeaponInertia)}, true] call CBA_fnc_addPlayerEventHandler;
["loadout", {[ACE_player] call FUNC(getWeaponInertia)}, true] call CBA_fnc_addPlayerEventHandler;
["unit", {[ACE_player] call FUNC(getWeaponInertia)}, true] call CBA_fnc_addPlayerEventHandler;
["CBA_settingsInitialized", {
if (!GVAR(enabled)) exitWith {};
["baseline", {
private _fatigue = ACE_player getVariable [QGVAR(aimFatigue), 0];
switch (stance ACE_player) do {
case ("CROUCH"): {
@ -15,9 +23,9 @@ if (!hasInterface) exitWith {};
(1.5 + _fatigue ^ 2 * 3.0)
};
};
}, QUOTE(ADDON)] call EFUNC(common,addSwayFactor);
}, QUOTE(ADDON)] call EFUNC(common,addSwayFactor);
["multiplier", {
["multiplier", {
switch (true) do {
case (isWeaponRested ACE_player): {
GVAR(swayFactor) * GVAR(restedSwayFactor)
@ -29,15 +37,7 @@ if (!hasInterface) exitWith {};
GVAR(swayFactor)
};
};
}, QUOTE(ADDON)] call EFUNC(common,addSwayFactor);
// recheck weapon inertia after weapon swap, change of attachments or switching unit
["weapon", {[ACE_player] call FUNC(getWeaponInertia)}, true] call CBA_fnc_addPlayerEventHandler;
["loadout", {[ACE_player] call FUNC(getWeaponInertia)}, true] call CBA_fnc_addPlayerEventHandler;
["unit", {[ACE_player] call FUNC(getWeaponInertia)}, true] call CBA_fnc_addPlayerEventHandler;
["CBA_settingsInitialized", {
if (!GVAR(enabled)) exitWith {};
}, QUOTE(ADDON)] call EFUNC(common,addSwayFactor);
// - Post process effect ------------------------------------------------------
GVAR(ppeBlackout) = ppEffectCreate ["ColorCorrections", 4220];