mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
30 lines
733 B
Plaintext
30 lines
733 B
Plaintext
/*
|
|
* Author: BaerMitUmlaut
|
|
* Disables turning on NVGs while the player aims down his sight.
|
|
*
|
|
* Arguments:
|
|
* 0: Unit <OBJECT>
|
|
* 1: New vision mode <NUMBER>
|
|
*
|
|
* Return Value:
|
|
* None
|
|
*
|
|
* Example:
|
|
* [player, 1] call ace_nightvision_fnc_onVisionModeChanged
|
|
*
|
|
* Public: No
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
params ["_unit", "_visionMode"];
|
|
|
|
if (GVAR(disableNVGsWithSights) && {(hmd _unit) != ""}) then {
|
|
(assignedVehicleRole _unit) params ["_role", "_turretPath"];
|
|
if ((vehicle _unit == _unit) || {isTurnedOut _unit} || {_role == "cargo" && {!(isNil "_turretPath")}}) then {
|
|
if ((cameraView == "GUNNER") && {_visionMode > 0}) then {
|
|
_unit action ["NVGogglesOff", _unit];
|
|
};
|
|
};
|
|
};
|