ACE3/addons/common/functions/fnc_getForceWalkStatus.sqf

37 lines
866 B
Plaintext
Raw Normal View History

/*
2015-09-20 23:07:49 +00:00
* Author: PabstMirror, commy2
* Returns reasons why the unit is forceWalk-ing.
*
* Arguments:
* 0: unit <OBJECT>
*
* Return Value:
* Force Walk reasons <ARRAY>
*
* Example:
* [ACE_Player] call ace_common_fnc_getForceWalkStatus
*
* Public: Yes
*/
2015-01-13 19:56:02 +00:00
#include "script_component.hpp"
2015-09-20 23:07:49 +00:00
params ["_unit"];
2015-09-20 23:07:49 +00:00
private ["_forceWalkReasons", "_unitForceWalkNumber", "_unitForceWalkStatus", "_unitForceWalkReasons"];
_forceWalkReasons = missionNamespace getVariable ["ACE_forceWalkReasons", []];
_unitForceWalkNumber = _unit getVariable ["ACE_forceWalkStatusNumber", 0];
2015-01-11 18:20:14 +00:00
_unitForceWalkStatus = [_unitForceWalkNumber, count _forceWalkReasons] call FUNC(binarizeNumber);
_unitForceWalkReasons = [];
2015-09-20 23:07:49 +00:00
{
2015-05-14 18:06:06 +00:00
if (_unitForceWalkStatus select _forEachIndex) then {
_unitForceWalkReasons pushBack _x;
};
} forEach _forceWalkReasons;
_unitForceWalkReasons