2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-04-11 12:02:44 +00:00
|
|
|
/*
|
|
|
|
* Author: KoffeinFlummi, Ruthberg
|
2017-11-18 12:59:42 +00:00
|
|
|
* Checks if the unit can change the zero adjustment of the current scope
|
2015-04-11 12:02:44 +00:00
|
|
|
*
|
2016-06-18 09:50:41 +00:00
|
|
|
* Arguments:
|
2015-04-11 12:02:44 +00:00
|
|
|
* 0: Unit <OBJECT>
|
|
|
|
*
|
2016-06-18 09:50:41 +00:00
|
|
|
* Return Value:
|
2015-04-11 12:02:44 +00:00
|
|
|
* Can we update the zero reference? <BOOL>
|
|
|
|
*
|
2015-08-07 14:43:06 +00:00
|
|
|
* Example:
|
|
|
|
* [player] call ace_scopes_fnc_canAdjustZero
|
|
|
|
*
|
2015-04-11 12:02:44 +00:00
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2015-08-07 14:43:06 +00:00
|
|
|
params ["_unit"];
|
|
|
|
|
2015-04-11 12:02:44 +00:00
|
|
|
if (cameraView == "GUNNER") exitWith {false};
|
2024-03-26 12:54:06 +00:00
|
|
|
if (!isNull objectParent _unit) exitWith {false};
|
2017-11-29 10:38:19 +00:00
|
|
|
if (GVAR(simplifiedZeroing)) exitWith {false};
|
2024-06-18 14:08:03 +00:00
|
|
|
if !(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) exitWith {false};
|
2015-04-11 12:02:44 +00:00
|
|
|
|
2017-10-10 14:39:59 +00:00
|
|
|
private _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex);
|
2015-04-11 12:02:44 +00:00
|
|
|
if (_weaponIndex < 0) exitWith {false};
|
|
|
|
|
2017-10-10 14:39:59 +00:00
|
|
|
private _adjustment = _unit getVariable [QGVAR(Adjustment), [[0, 0, 0], [0, 0, 0], [0, 0, 0]]];
|
|
|
|
private _elevation = (_adjustment select _weaponIndex) select 0;
|
2015-04-11 12:02:44 +00:00
|
|
|
|
|
|
|
// You can only adjust your zero reference, if your relative elevation setting is not 0
|
|
|
|
_elevation != 0
|