diff --git a/addons/safemode/functions/fnc_lockSafety.sqf b/addons/safemode/functions/fnc_lockSafety.sqf index e3c1b71f309..c3ce5a8b868 100644 --- a/addons/safemode/functions/fnc_lockSafety.sqf +++ b/addons/safemode/functions/fnc_lockSafety.sqf @@ -60,7 +60,19 @@ if (_unit getVariable [QGVAR(actionID), -1] == -1) then { }; if (_muzzle isEqualType "") then { + private _laserEnabled = _unit isIRLaserOn _weapon || {_unit isFlashlightOn _weapon}; + _unit selectWeapon _muzzle; + + if ( + _laserEnabled + && { + _muzzle == primaryWeapon _unit // prevent UGL switch + || {"" == primaryWeapon _unit} // Arma switches to primary weapon if exists + } + ) then { + {_unit action [_x, _unit]} forEach ["GunLightOn", "IRLaserOn"]; + }; }; // play fire mode selector sound diff --git a/addons/safemode/functions/fnc_unlockSafety.sqf b/addons/safemode/functions/fnc_unlockSafety.sqf index 5a787277e4f..3194de6f14d 100644 --- a/addons/safemode/functions/fnc_unlockSafety.sqf +++ b/addons/safemode/functions/fnc_unlockSafety.sqf @@ -30,8 +30,20 @@ if (_safedWeapons isEqualTo []) then { _unit setVariable [QGVAR(actionID), -1]; }; +private _laserEnabled = _unit isIRLaserOn _weapon || {_unit isFlashlightOn _weapon}; + _unit selectWeapon _muzzle; +if ( + _laserEnabled + && { + _muzzle == primaryWeapon _unit // prevent UGL switch + || {"" == primaryWeapon _unit} // Arma switches to primary weapon if exists + } +) then { + {_unit action [_x, _unit]} forEach ["GunLightOn", "IRLaserOn"]; +}; + if (inputAction "nextWeapon" > 0) then { // switch to the last mode to roll over to first after the default nextWeapon action // get weapon modes