2018-09-17 19:19:29 +00:00
|
|
|
#include "script_component.hpp"
|
2015-01-11 16:42:31 +00:00
|
|
|
/*
|
|
|
|
* Author: commy2
|
|
|
|
* Get the turret index of a units current turret.
|
|
|
|
*
|
2015-09-20 21:40:51 +00:00
|
|
|
* Arguments:
|
|
|
|
* 0: Unit <OBJECT>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* Turret Index <ARRAY>
|
2015-01-11 16:42:31 +00:00
|
|
|
*
|
2015-10-04 04:05:46 +00:00
|
|
|
* Example:
|
|
|
|
* [ace_player] call ace_common_fnc_getTurretIndex
|
|
|
|
*
|
2015-09-20 21:40:51 +00:00
|
|
|
* Public: Yes
|
2015-01-11 16:42:31 +00:00
|
|
|
*/
|
|
|
|
|
2015-12-12 15:48:54 +00:00
|
|
|
params [["_unit", objNull, [objNull]]];
|
2015-09-20 21:40:51 +00:00
|
|
|
|
2015-11-17 16:43:07 +00:00
|
|
|
private _vehicle = vehicle _unit;
|
2015-01-16 20:16:42 +00:00
|
|
|
if (_unit == _vehicle) exitWith {[]};
|
|
|
|
|
2021-10-30 21:42:03 +00:00
|
|
|
scopeName "main";
|
2015-09-20 21:40:51 +00:00
|
|
|
|
2015-01-11 16:42:31 +00:00
|
|
|
{
|
2015-10-04 04:05:46 +00:00
|
|
|
if (_unit == (_vehicle turretUnit _x)) then {_x breakOut "main"};
|
|
|
|
nil
|
|
|
|
} count allTurrets [_vehicle, true];
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-10-04 04:05:46 +00:00
|
|
|
[]
|