ACE3/addons/common/functions/fnc_getForceWalkStatus.sqf
2015-01-12 19:22:58 +01:00

38 lines
956 B
Plaintext

/*
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)
*/
#include "\z\ace\addons\common\script_component.hpp"
private ["_unit", "_forceWalkReasons", "_unitForceWalkNumber", "_unitForceWalkStatus", "_unitForceWalkReasons"];
_unit = _this select 0;
_forceWalkReasons = missionNamespace getVariable ["ACE_forceWalkReasons", []];
_unitForceWalkNumber = _unit getVariable ["ACE_forceWalkStatusNumber", 0];
_unitForceWalkStatus = [_unitForceWalkNumber, count _forceWalkReasons] call FUNC(binarizeNumber);
_unitForceWalkReasons = [];
{
if (_unitForceWalkStatus select _forEachIndex) then {
_unitForceWalkReasons pushBack _x;
};
} forEach _forceWalkReasons;
_unitForceWalkReasons