diff --git a/addons/recoil/XEH_preInit.sqf b/addons/recoil/XEH_preInit.sqf index 1566a79fd48..11c0a294a2a 100644 --- a/addons/recoil/XEH_preInit.sqf +++ b/addons/recoil/XEH_preInit.sqf @@ -9,4 +9,8 @@ PREP_RECOMPILE_END; GVAR(recoilCache) = createHashMap; +// This is too niche to be a setting, but making it not just hardcoded is good +GVAR(extraLauncherShake) = 25.0; + + ADDON = true; diff --git a/addons/recoil/functions/fnc_camshake.sqf b/addons/recoil/functions/fnc_camshake.sqf index 9c6e78608f8..918758800ac 100644 --- a/addons/recoil/functions/fnc_camshake.sqf +++ b/addons/recoil/functions/fnc_camshake.sqf @@ -38,6 +38,12 @@ private _recoil = GVAR(recoilCache) getOrDefaultCall [_weapon + _muzzle, { getText (_config >> _muzzle >> "recoil") }; + private _customShakeCoef = if (isNumber (configFile >> "CfgRecoils" >> _recoil >> QGVAR(customShakeCoef))) then { + getNumber (configFile >> "CfgRecoils" >> _recoil >> QGVAR(customShakeCoef)) + } else { + 1 + }; + if (isClass (configFile >> "CfgRecoils" >> _recoil)) then { _recoil = getArray (configFile >> "CfgRecoils" >> _recoil >> "kickBack"); @@ -48,6 +54,10 @@ private _recoil = GVAR(recoilCache) getOrDefaultCall [_weapon + _muzzle, { _recoil = [0, 0]; }; + + + _recoil = _recoil vectorMultiply _customShakeCoef; + TRACE_3("Caching Recoil config",_weapon,_muzzle,_recoil); // Ensure format is correct @@ -62,7 +72,7 @@ private _powerCoef = RECOIL_COEF * linearConversion [0, 1, random 1, _recoil sel if (isWeaponRested _unit) then {_powerMod = _powerMod - 0.07}; if (isWeaponDeployed _unit) then {_powerMod = _powerMod - 0.11}; if (_weapon isEqualTo secondaryWeapon _unit) then { - _powerCoef = _powerCoef + 25.0; + _powerCoef = _powerCoef + GVAR(extraLauncherShake); }; private _camshake = [