mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
37 lines
866 B
Plaintext
37 lines
866 B
Plaintext
/*
|
|
* 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
|
|
*/
|
|
#include "script_component.hpp"
|
|
|
|
params ["_unit"];
|
|
|
|
private ["_forceWalkReasons", "_unitForceWalkNumber", "_unitForceWalkStatus", "_unitForceWalkReasons"];
|
|
|
|
_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
|