mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Scopes - Fix undefined enum types (#5969)
This commit is contained in:
@ -18,6 +18,7 @@
|
|||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
params ["_unit", "_turretAndDirection", "_majorStep"];
|
params ["_unit", "_turretAndDirection", "_majorStep"];
|
||||||
|
TRACE_3("adjustScope",_unit,_turretAndDirection,_majorStep);
|
||||||
|
|
||||||
if (!(_unit isKindOf "Man")) exitWith {false};
|
if (!(_unit isKindOf "Man")) exitWith {false};
|
||||||
if (currentMuzzle _unit != currentWeapon _unit) exitWith {false};
|
if (currentMuzzle _unit != currentWeapon _unit) exitWith {false};
|
||||||
@ -26,14 +27,16 @@ if (!GVAR(enabled)) exitWith {false};
|
|||||||
private _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex);
|
private _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex);
|
||||||
if (_weaponIndex < 0) exitWith {false};
|
if (_weaponIndex < 0) exitWith {false};
|
||||||
|
|
||||||
|
TRACE_2("",GVAR(canAdjustElevation),GVAR(canAdjustWindage));
|
||||||
if (!(GVAR(canAdjustElevation) select _weaponIndex) && (_turretAndDirection in [ELEVATION_UP, ELEVATION_DOWN])) exitWith {false};
|
if (!(GVAR(canAdjustElevation) select _weaponIndex) && (_turretAndDirection in [ELEVATION_UP, ELEVATION_DOWN])) exitWith {false};
|
||||||
if (!(GVAR(canAdjustWindage) select _weaponIndex) && (_turretAndDirection in [WINDAGE_UP, WINDAGE_DOWN])) exitWith {false};
|
if (!(GVAR(canAdjustWindage) select _weaponIndex) && (_turretAndDirection in [WINDAGE_LEFT, WINDAGE_RIGHT])) exitWith {false};
|
||||||
|
|
||||||
private _adjustment = _unit getVariable [QGVAR(Adjustment), [[0, 0, 0], [0, 0, 0], [0, 0, 0]]];
|
private _adjustment = _unit getVariable [QGVAR(Adjustment), [[0, 0, 0], [0, 0, 0], [0, 0, 0]]];
|
||||||
private _zeroing = _adjustment select _weaponIndex;
|
private _zeroing = _adjustment select _weaponIndex;
|
||||||
_zeroing params ["_elevation", "_windage", "_zero"];
|
_zeroing params ["_elevation", "_windage", "_zero"];
|
||||||
|
|
||||||
(GVAR(scopeAdjust) select _weaponIndex) params ["_maxVertical", "_verticalIncrement", "_maxHorizontal", "_horizontalIncrement"];
|
(GVAR(scopeAdjust) select _weaponIndex) params ["_maxVertical", "_verticalIncrement", "_maxHorizontal", "_horizontalIncrement"];
|
||||||
|
TRACE_4("",_maxVertical,_verticalIncrement,_maxHorizontal,_horizontalIncrement);
|
||||||
|
|
||||||
switch (_turretAndDirection) do {
|
switch (_turretAndDirection) do {
|
||||||
case ELEVATION_UP: { _elevation = _elevation + _verticalIncrement };
|
case ELEVATION_UP: { _elevation = _elevation + _verticalIncrement };
|
||||||
|
Reference in New Issue
Block a user