mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
24 lines
365 B
Plaintext
24 lines
365 B
Plaintext
/*
|
|
* Author: commy2
|
|
*
|
|
* Convert an array of booleans into a number.
|
|
*
|
|
* Argument:
|
|
* 0: Booleans (Array of Booleans)
|
|
*
|
|
* Return value:
|
|
* Bitmask (Number)
|
|
*/
|
|
#include "\z\ace\addons\core\script_component.hpp"
|
|
|
|
private ["_array", "_result"];
|
|
|
|
_array = _this;
|
|
|
|
_result = 0;
|
|
{
|
|
if (_x) then {_result = _result + 2 ^ _forEachIndex};
|
|
} forEach _array;
|
|
|
|
_result
|