2015-01-11 16:42:31 +00:00
|
|
|
/*
|
|
|
|
* Author: commy2
|
|
|
|
* Return the captivity status of an unit.
|
|
|
|
*
|
2015-09-20 21:18:51 +00:00
|
|
|
* Arguments:
|
|
|
|
* 0: Unit <OBJECT>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* Captivity Reasons, empty if not captive <ARRAY>
|
2015-01-11 16:42:31 +00:00
|
|
|
*
|
2015-09-20 21:18:51 +00:00
|
|
|
* Public: Yes
|
2015-01-11 16:42:31 +00:00
|
|
|
*/
|
2015-01-13 19:56:02 +00:00
|
|
|
#include "script_component.hpp"
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-09-20 21:18:51 +00:00
|
|
|
params ["_unit"];
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-09-20 21:18:51 +00:00
|
|
|
private ["_captivityReasons", "_unitCaptivityStatus", "_unitCaptivityReasons"];
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-01-12 04:02:33 +00:00
|
|
|
_captivityReasons = missionNamespace getVariable ["ACE_captivityReasons", []];
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-01-11 18:20:14 +00:00
|
|
|
_unitCaptivityStatus = [captiveNum _unit, count _captivityReasons] call FUNC(binarizeNumber);
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
_unitCaptivityReasons = [];
|
2015-09-20 21:18:51 +00:00
|
|
|
|
2015-01-11 16:42:31 +00:00
|
|
|
{
|
2015-05-14 18:06:06 +00:00
|
|
|
if (_unitCaptivityStatus select _forEachIndex) then {
|
|
|
|
_unitCaptivityReasons pushBack _x;
|
|
|
|
};
|
2015-01-11 16:42:31 +00:00
|
|
|
} forEach _captivityReasons;
|
|
|
|
|
|
|
|
_unitCaptivityReasons
|