mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Switch to unit namespace, added !hasHatch condition
This commit is contained in:
parent
2fe53431c7
commit
a1d72b81bf
@ -70,5 +70,3 @@ GVAR(ppEffectMuzzleFlash) ppEffectCommit 0;
|
|||||||
},
|
},
|
||||||
{false},
|
{false},
|
||||||
[209, [false, false, true]], false] call cba_fnc_addKeybind; //PageDown + ALT
|
[209, [false, false, true]], false] call cba_fnc_addKeybind; //PageDown + ALT
|
||||||
|
|
||||||
GVAR(reenableNVGs) = false;
|
|
||||||
|
@ -20,15 +20,18 @@
|
|||||||
params ["_unit", "_cameraView"];
|
params ["_unit", "_cameraView"];
|
||||||
|
|
||||||
if (GVAR(disableNVGsWithSights) && {(hmd _unit) != ""}) then {
|
if (GVAR(disableNVGsWithSights) && {(hmd _unit) != ""}) then {
|
||||||
(assignedVehicleRole _unit) params ["_role", "_turretPath"];
|
if ((vehicle _unit == _unit)
|
||||||
if ((vehicle _unit == _unit) || {isTurnedOut _unit} || {_role == "cargo" && {!(isNil "_turretPath")}}) then {
|
|| {isTurnedOut _unit}
|
||||||
if ((_cameraView == "GUNNER") && {currentVisionMode _unit > 0}) then {
|
|| {!([_unit] call EFUNC(common,hasHatch))
|
||||||
|
&& {[_unit] call EFUNC(common,getTurretIndex) in ([vehicle _unit] call EFUNC(common,getTurretsFFV))}
|
||||||
|
}) then {
|
||||||
|
if ((_cameraView == "GUNNER") && {currentVisionMode _unit == 1}) then {
|
||||||
_unit action ["NVGogglesOff", _unit];
|
_unit action ["NVGogglesOff", _unit];
|
||||||
GVAR(reenableNVGs) = true;
|
_unit setVariable [QGVAR(reenableNVGs), true];
|
||||||
} else {
|
} else {
|
||||||
if (GVAR(reenableNVGs) && {_cameraView != "GUNNER"}) then {
|
if (_unit getVariable [QGVAR(reenableNVGs), false] && {_cameraView != "GUNNER"}) then {
|
||||||
_unit action ["NVGoggles", _unit];
|
_unit action ["NVGoggles", _unit];
|
||||||
GVAR(reenableNVGs) = false;
|
_unit setVariable [QGVAR(reenableNVGs), false];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user