ACE3/addons/common/functions/fnc_toBitmask.sqf
Phyma ffaa195fe5 Conform function headers to coding guidelines (#5255)
* Fixed headers to work with silentspike python script

* Fixed rest of the files

* Fixed ace-team
2017-06-08 15:31:51 +02:00

25 lines
375 B
Plaintext

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