2015-01-11 16:42:31 +00:00
|
|
|
/*
|
|
|
|
* Author: commy2
|
|
|
|
* Convert an array of booleans into a number.
|
|
|
|
*
|
2015-09-17 16:25:02 +00:00
|
|
|
* Arguments:
|
2015-09-19 22:55:58 +00:00
|
|
|
* N: Booleans <ARRAY>
|
2015-01-11 16:42:31 +00:00
|
|
|
*
|
2015-09-17 16:25:02 +00:00
|
|
|
* Return Value:
|
2015-09-19 22:55:58 +00:00
|
|
|
* Bitmask <NUMBER>
|
2015-09-17 16:25:02 +00:00
|
|
|
*
|
|
|
|
* Public: Yes
|
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-09-20 13:52:40 +00:00
|
|
|
private "_result";
|
2015-01-11 16:42:31 +00:00
|
|
|
_result = 0;
|
2015-09-19 22:55:58 +00:00
|
|
|
|
2015-01-11 16:42:31 +00:00
|
|
|
{
|
2015-05-14 18:06:06 +00:00
|
|
|
if (_x) then {_result = _result + 2 ^ _forEachIndex};
|
2015-09-20 13:52:40 +00:00
|
|
|
} forEach _this;
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
_result
|