diff --git a/addons/common/functions/fnc_getTurretCommander.sqf b/addons/common/functions/fnc_getTurretCommander.sqf index e73795e1487..3e7f09215fb 100644 --- a/addons/common/functions/fnc_getTurretCommander.sqf +++ b/addons/common/functions/fnc_getTurretCommander.sqf @@ -14,19 +14,4 @@ params [["_vehicle", objNull, [objNull]]]; -private _turrets = allTurrets [_vehicle, true]; - -private _turret = []; - -{ - private _config = configFile >> "CfgVehicles" >> typeOf _vehicle; - - _config = [_config, _x] call FUNC(getTurretConfigPath); - - if (getNumber (_config >> "primaryObserver") == 1) exitWith { - _turret = _x; - }; - false -} count _turrets; - -_turret +fullCrew [_vehicle, "commander", true] apply {_x select 3} param [0, []] // return diff --git a/addons/common/functions/fnc_getTurretCopilot.sqf b/addons/common/functions/fnc_getTurretCopilot.sqf index 6161f5c4cc3..49002cc40e7 100644 --- a/addons/common/functions/fnc_getTurretCopilot.sqf +++ b/addons/common/functions/fnc_getTurretCopilot.sqf @@ -14,19 +14,6 @@ params [["_vehicle", objNull, [objNull]]]; -private _turrets = allTurrets [_vehicle, true]; - -private _turret = []; - -{ - private _config = configFile >> "CfgVehicles" >> typeOf _vehicle; - - _config = [_config, _x] call FUNC(getTurretConfigPath); - - if (getNumber (_config >> "isCopilot") == 1 && {getNumber (_config >> "primaryGunner") != 1} && {getNumber (_config >> "primaryObserver") != 1}) exitWith { - _turret = _x; - }; - false -} count _turrets; - -_turret +fullCrew [_vehicle, "turret", true] apply {_x select 3} select { + getNumber ([_vehicle, _x] call CBA_fnc_getTurret >> "isCopilot") == 1 +} param [0, []] // return diff --git a/addons/common/functions/fnc_getTurretGunner.sqf b/addons/common/functions/fnc_getTurretGunner.sqf index 6f59798cc6d..4a26e2c03df 100644 --- a/addons/common/functions/fnc_getTurretGunner.sqf +++ b/addons/common/functions/fnc_getTurretGunner.sqf @@ -14,19 +14,4 @@ params [["_vehicle", objNull, [objNull]]]; -private _turrets = allTurrets [_vehicle, true]; - -private _turret = []; - -{ - private _config = configFile >> "CfgVehicles" >> typeOf _vehicle; - - _config = [_config, _x] call FUNC(getTurretConfigPath); - - if (getNumber (_config >> "primaryGunner") == 1) exitWith { - _turret = _x; - }; - false -} count _turrets; - -_turret +fullCrew [_vehicle, "gunner", true] apply {_x select 3} param [0, []] // return diff --git a/addons/common/functions/fnc_getTurrets.sqf b/addons/common/functions/fnc_getTurrets.sqf index 229f3ab1f79..04795807643 100644 --- a/addons/common/functions/fnc_getTurrets.sqf +++ b/addons/common/functions/fnc_getTurrets.sqf @@ -8,12 +8,14 @@ * Return Value: * Turret Indecies * - * Public: Yes + * Public: No * * Note: It's advised to use allTurrets [_vehicle, true] instead whenever possible */ #include "script_component.hpp" +ACE_DEPRECATED("ace_common_fnc_getTurrets","3.7.0","allTurrets [_vehicle, true]"); + params ["_type"]; private _varName = format [QGVAR(CachedTurrets_%1), _type]; diff --git a/addons/common/functions/fnc_getTurretsFFV.sqf b/addons/common/functions/fnc_getTurretsFFV.sqf index 8c471824cf5..5c36e201975 100644 --- a/addons/common/functions/fnc_getTurretsFFV.sqf +++ b/addons/common/functions/fnc_getTurretsFFV.sqf @@ -14,19 +14,4 @@ params [["_vehicle", objNull, [objNull]]]; -private _turrets = allTurrets [_vehicle, true]; - -private _turret = []; - -{ - private _config = configFile >> "CfgVehicles" >> typeOf _vehicle; - - _config = [_config, _x] call FUNC(getTurretConfigPath); - - if (getNumber (_config >> "isPersonTurret") == 1) then { - _turret pushBack _x; - }; - false -} count _turrets; - -_turret +fullCrew [_vehicle, "turret", true] select {_x select 4} apply {_x select 3} // return diff --git a/addons/common/functions/fnc_getTurretsOther.sqf b/addons/common/functions/fnc_getTurretsOther.sqf index 408a5529d56..ef2a1278dc1 100644 --- a/addons/common/functions/fnc_getTurretsOther.sqf +++ b/addons/common/functions/fnc_getTurretsOther.sqf @@ -14,24 +14,6 @@ params [["_vehicle", objNull, [objNull]]]; -private _turrets = allTurrets [_vehicle, true]; - -private _turret = []; - -{ - private _config = configFile >> "CfgVehicles" >> typeOf _vehicle; - - _config = [_config, _x] call FUNC(getTurretConfigPath); - - if ( - getNumber (_config >> "isCopilot") != 1 - && {getNumber (_config >> "primaryGunner") != 1} - && {getNumber (_config >> "primaryObserver") != 1} - && {getNumber (_config >> "isPersonTurret") != 1} - ) then { - _turret pushBack _x; - }; - false -} count _turrets; - -_turret +fullCrew [_vehicle, "turret", true] select {!(_x select 4)} apply {_x select 3} select { + getNumber ([_vehicle, _x] call CBA_fnc_getTurret >> "isCopilot") != 1 +} // return