Skip to content

Commit

Permalink
Merge pull request #1460 from CBATeam/uavTurretDir
Browse files Browse the repository at this point in the history
Fix CBA_fnc_turretDir for certain UAV turrets
  • Loading branch information
PabstMirror committed Jun 3, 2021
2 parents 1d8c685 + 838adf4 commit 0ca8baf
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions addons/common/fnc_turretDir.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ private _turretConfig = [_vehicle, _turret] call CBA_fnc_getTurret;
private _gunBeg = _vehicle selectionPosition getText (_turretConfig >> "gunBeg");
private _gunEnd = _vehicle selectionPosition getText (_turretConfig >> "gunEnd");

if (_gunEnd isEqualTo _gunBeg) then {
private _vehicleConfig = configOf _vehicle;
if (((getNumber (_vehicleConfig >> "isUAV")) == 1) && {_turret isEqualto [0]}) then {
_gunBeg = _vehicle selectionPosition getText (_vehicleConfig >> "uavCameraGunnerDir");
_gunEnd = _vehicle selectionPosition getText (_vehicleConfig >> "uavCameraGunnerPos");
} else {
WARNING_2("Vehicle %1 has invalid gun configs on turret %2",configName _vehicleConfig,_turret);
};
};

if !(_relativeToModel) then {
_gunBeg = AGLToASL (_vehicle modelToWorld _gunBeg);
_gunEnd = AGLToASL (_vehicle modelToWorld _gunEnd);
Expand Down

0 comments on commit 0ca8baf

Please sign in to comment.