Fix undefined error _hasBloodBag in fn_damageActions

When this function was passed an empty array (like a player with no
magazines) it returned undefined because the inside of the forEach loop
did not execute.
This commit is contained in:
ebaydayz
2016-10-01 11:31:18 -04:00
parent 11fa6a631c
commit 76273d06cd

View File

@@ -8,11 +8,13 @@ dz_fn_array_pushBack =
//Returns true if the given predicate evaluates to true for any element in the array
dz_fn_array_any =
{
private "_return";
_return = false;
{
if (_x call (_this select 1)) exitWith { true };
false
if (_x call (_this select 1)) exitWith { _return = true };
}
foreach (_this select 0);
_return
};
//Returns true if the given predicate evaluates to true for all elements in the array