Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support configNull and teamMemberNull in CBA_fnc_findNull, use params in CBA_fnc_findNil #212

Merged
merged 4 commits into from
Dec 11, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions addons/arrays/fnc_findNil.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Parameters:

Example:
(begin example)
_index = ["", Player, "test", nil, VARIABLE, nil] call CBA_fnc_findNil
_index = ["", player, "test", nil, _variable, nil] call CBA_fnc_findNil
(end)

Returns:
Expand All @@ -20,14 +20,14 @@ Author:
---------------------------------------------------------------------------- */
#include "script_component.hpp"

if !(IS_ARRAY(_this)) exitWith {-1};
[_this] params [["_array", [], [[]]]];

scopeName "main";

{
if (isNil "_x") then {
_forEachIndex breakOut "main";
};
} forEach _this;
} forEach _array;

-1
12 changes: 5 additions & 7 deletions addons/arrays/fnc_findNull.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Parameters:

Example:
(begin example)
_index = ["", Player, "test", objNull, VARIABLE] call CBA_fnc_findNull
_index = ["", player, "test", objNull, _variable] call CBA_fnc_findNull
(end)

Returns:
Expand All @@ -20,18 +20,16 @@ Author:
---------------------------------------------------------------------------- */
#include "script_component.hpp"

if !(IS_ARRAY(_this)) exitWith {-1};
[_this] params [["_array", [], [[]]]];

scopeName "main";

private "_checkableTypes";

_checkableTypes = ["OBJECT", "CONTROL", "DISPLAY", "GROUP", "LOCATION", "TASK", "SCRIPT"];
private _nullTypes = [objNull, controlNull, displayNull, grpNull, teamMemberNull, locationNull, taskNull, scriptNull, configNull];

{
if (typeName _x in _checkableTypes && {isNull _x}) then {
if (_x in _nullTypes) then {
_forEachIndex breakOut "main";
};
} forEach _this;
} forEach _array;

-1
1 change: 1 addition & 0 deletions addons/arrays/test_findNil.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ SCRIPT(test_findNil);

// ----------------------------------------------------------------------------

disableSerialization;
private ["_expected", "_result", "_fn"];

_fn = "CBA_fnc_findNil";
Expand Down
1 change: 1 addition & 0 deletions addons/arrays/test_findNull.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ SCRIPT(test_findNull);

// ----------------------------------------------------------------------------

disableSerialization;
private ["_original", "_expected", "_result", "_fn"];

_fn = "CBA_fnc_findNull";
Expand Down
1 change: 1 addition & 0 deletions addons/arrays/test_findTypeName.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ SCRIPT(test_findTypeName);

// ----------------------------------------------------------------------------

disableSerialization;
private ["_array", "_expected", "_result", "_fn"];

_fn = "CBA_fnc_findTypeName";
Expand Down