mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
24 lines
453 B
Plaintext
24 lines
453 B
Plaintext
/**
|
|
* fn_uniqueElementsOnly.sqf
|
|
* @Descr: Make a copy of an array with only the unique elements.
|
|
* @Author: Glowbal
|
|
*
|
|
* @Arguments: [array ARRAY]
|
|
* @Return: ARRAY Copy of original array
|
|
* @PublicAPI: true
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
private ["_result", "_value"];
|
|
PARAMS_1(_array);
|
|
|
|
_result = [];
|
|
{
|
|
_value = _x;
|
|
if ({_x isEqualTo _value} count _result == 0) then {
|
|
_result pushback _x;
|
|
};
|
|
} forEach _array;
|
|
|
|
_result; |