From 8d89c62239409512be3076d0b098c257b43e5efe Mon Sep 17 00:00:00 2001 From: F507DMT <12347771234@mail.ru> Date: Wed, 5 May 2021 12:17:26 +0600 Subject: [PATCH] Update fn_buildWeightedArray.sqf private fix --- SQF/dayz_code/compile/fn_buildWeightedArray.sqf | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/SQF/dayz_code/compile/fn_buildWeightedArray.sqf b/SQF/dayz_code/compile/fn_buildWeightedArray.sqf index d9e9d8d7c..6a190be82 100644 --- a/SQF/dayz_code/compile/fn_buildWeightedArray.sqf +++ b/SQF/dayz_code/compile/fn_buildWeightedArray.sqf @@ -18,9 +18,9 @@ scriptName "Functions\arrays\fn_selectRandomWeighted.sqf"; [*] Algorithm is inefficient? */ -private["_weighted"]; +private["_weights","_weighted","_weight"]; -_array = _this select 0; +// _array = _this select 0; _weights = _this select 1; /* @@ -34,7 +34,6 @@ if ((count _array) > (count _weights)) exitWith {debugLog "Log: [selectRandomWei _weighted = []; for "_i" from 0 to ((count _weights) - 1) do { - private ["_weight"]; _weight = _weights select _i; //Ensure the weight is a Number. @@ -53,4 +52,4 @@ for "_i" from 0 to ((count _weights) - 1) do _weighted set [(count _weighted), _i]; }; }; -_weighted \ No newline at end of file +_weighted