ACE3/addons/common/functions/fnc_toBitmask.sqf
2015-09-17 18:25:02 +02:00

26 lines
367 B
Plaintext

/*
* Author: commy2
*
* Convert an array of booleans into a number.
*
* Arguments:
* N: Booleans <ARRAY of Booleans>
*
* Return Value:
* Bitmask (Number)
*
* Public: Yes
*/
#include "script_component.hpp"
private ["_array", "_result"];
_array = _this;
_result = 0;
{
if (_x) then {_result = _result + 2 ^ _forEachIndex};
} forEach _array;
_result