2015-01-11 16:42:31 +00:00
|
|
|
/*
|
2015-01-11 18:20:14 +00:00
|
|
|
Name: FUNC(getForceWalkStatus)
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
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:
|
2015-01-12 04:02:33 +00:00
|
|
|
[ACE_Player] call FUNC(getForceWalkStatus)
|
2015-01-11 16:42:31 +00:00
|
|
|
*/
|
2015-01-13 19:56:02 +00:00
|
|
|
#include "script_component.hpp"
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-05-14 18:06:06 +00:00
|
|
|
private ["_forceWalkReasons", "_unitForceWalkNumber", "_unitForceWalkStatus", "_unitForceWalkReasons"];
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-05-14 18:06:06 +00:00
|
|
|
PARAMS_1(_unit);
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-01-12 04:02:33 +00:00
|
|
|
_forceWalkReasons = missionNamespace getVariable ["ACE_forceWalkReasons", []];
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-01-12 04:02:33 +00:00
|
|
|
_unitForceWalkNumber = _unit getVariable ["ACE_forceWalkStatusNumber", 0];
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-01-11 18:20:14 +00:00
|
|
|
_unitForceWalkStatus = [_unitForceWalkNumber, count _forceWalkReasons] call FUNC(binarizeNumber);
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
_unitForceWalkReasons = [];
|
|
|
|
{
|
2015-05-14 18:06:06 +00:00
|
|
|
if (_unitForceWalkStatus select _forEachIndex) then {
|
|
|
|
_unitForceWalkReasons pushBack _x;
|
|
|
|
};
|
2015-01-11 16:42:31 +00:00
|
|
|
} forEach _forceWalkReasons;
|
|
|
|
|
|
|
|
_unitForceWalkReasons
|