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,35 +2,6 @@
if (!hasInterface) exitWith {};
["baseline", {
private _fatigue = ACE_player getVariable [QGVAR(aimFatigue), 0];
switch (stance ACE_player) do {
case ("CROUCH"): {
(1.0 + _fatigue ^ 2 * 0.1)
};
case ("PRONE"): {
(1.0 + _fatigue ^ 2 * 2.0)
};
default {
(1.5 + _fatigue ^ 2 * 3.0)
};
};
}, QUOTE(ADDON)] call EFUNC(common,addSwayFactor);
["multiplier", {
switch (true) do {
case (isWeaponRested ACE_player): {
GVAR(swayFactor) * GVAR(restedSwayFactor)
};
case (isWeaponDeployed ACE_player): {
GVAR(swayFactor) * GVAR(deployedSwayFactor)
};
default {
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;
@ -39,6 +10,35 @@ if (!hasInterface) exitWith {};
["CBA_settingsInitialized", {
if (!GVAR(enabled)) exitWith {};
["baseline", {
private _fatigue = ACE_player getVariable [QGVAR(aimFatigue), 0];
switch (stance ACE_player) do {
case ("CROUCH"): {
(1.0 + _fatigue ^ 2 * 0.1)
};
case ("PRONE"): {
(1.0 + _fatigue ^ 2 * 2.0)
};
default {
(1.5 + _fatigue ^ 2 * 3.0)
};
};
}, QUOTE(ADDON)] call EFUNC(common,addSwayFactor);
["multiplier", {
switch (true) do {
case (isWeaponRested ACE_player): {
GVAR(swayFactor) * GVAR(restedSwayFactor)
};
case (isWeaponDeployed ACE_player): {
GVAR(swayFactor) * GVAR(deployedSwayFactor)
};
default {
GVAR(swayFactor)
};
};
}, QUOTE(ADDON)] call EFUNC(common,addSwayFactor);
// - Post process effect ------------------------------------------------------
GVAR(ppeBlackout) = ppEffectCreate ["ColorCorrections", 4220];
GVAR(ppeBlackout) ppEffectEnable true;