mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
38 lines
956 B
Plaintext
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
|