ACE3/addons/common/functions/fnc_getForceWalkStatus.sqf

38 lines
935 B
Plaintext
Raw Normal View History

/*
2015-01-11 18:20:14 +00:00
Name: FUNC(getForceWalkStatus)
Author: Pabst Mirror (from captivity by commy2)
Description:
Returns reasons why the unit is forceWalk-ing, empty if not forced.
Parameters:
0: OBJECT - Unit
Returns:
ARRAY(of strings) - Reason why the unit is force walking
Example:
[ACE_Player] call FUNC(getForceWalkStatus)
*/
2015-01-13 19:56:02 +00:00
#include "script_component.hpp"
private ["_unit", "_forceWalkReasons", "_unitForceWalkNumber", "_unitForceWalkStatus", "_unitForceWalkReasons"];
_unit = _this select 0;
_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 = [];
{
if (_unitForceWalkStatus select _forEachIndex) then {
_unitForceWalkReasons pushBack _x;
};
} forEach _forceWalkReasons;
_unitForceWalkReasons