ACE3/addons/common/functions/fnc_getDoorTurrets.sqf

32 lines
690 B
Plaintext
Raw Normal View History

/*
* Author: bux578
*
* Gets the turret index of door gunners
*
* Argument:
2015-03-25 21:50:28 +00:00
* 0: Vehicle (Object)
*
* Return value:
* Turret indexes of the door gunner. Empty array means no gunner position. (Array)
*/
2015-01-13 19:56:02 +00:00
#include "script_component.hpp"
2015-03-25 21:50:28 +00:00
private ["_vehicle", "_turrets", "_doorTurrets", "_config"];
2015-03-25 21:50:28 +00:00
_vehicle = _this select 0;
2015-03-25 21:50:28 +00:00
_turrets = allTurrets [_vehicle, true];
_doorTurrets = [];
{
2015-03-25 21:50:28 +00:00
_config = configFile >> "CfgVehicles" >> typeOf _vehicle;
2015-01-11 18:20:14 +00:00
_config = [_config, _x] call FUNC(getTurretConfigPath);
if ((getNumber (_config >> "isCopilot") == 0) && count (getArray (_config >> "weapons")) > 0 ) then {
_doorTurrets pushBack _x;
};
} forEach _turrets;
_doorTurrets