From 57b411b8a4e128069958ce4451aeb266cc3a61b9 Mon Sep 17 00:00:00 2001 From: Whigital Date: Tue, 11 Feb 2020 23:40:15 +0100 Subject: [PATCH] conform isnil checking: arsenal --- addons/arsenal/XEH_postInit.sqf | 4 ++-- addons/arsenal/functions/fnc_fillLeftPanel.sqf | 2 +- addons/arsenal/functions/fnc_fillRightPanel.sqf | 2 +- addons/arsenal/functions/fnc_handleStats.sqf | 2 +- addons/arsenal/functions/fnc_message.sqf | 2 +- addons/arsenal/functions/fnc_onSelChangedLeft.sqf | 4 ++-- addons/arsenal/functions/fnc_removeBox.sqf | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/addons/arsenal/XEH_postInit.sqf b/addons/arsenal/XEH_postInit.sqf index dcc5c7c7b5..664f175bae 100644 --- a/addons/arsenal/XEH_postInit.sqf +++ b/addons/arsenal/XEH_postInit.sqf @@ -24,7 +24,7 @@ GVAR(lastSearchTextLoadouts) = ""; [QGVAR(loadoutUnshared), { params ["_contentPanelCtrl" , "_playerName", "_loadoutName"]; - if (!(isNil QGVAR(currentLoadoutsTab)) && {GVAR(currentLoadoutsTab) == IDC_buttonSharedLoadouts}) then { + if ((!isNil QGVAR(currentLoadoutsTab)) && {GVAR(currentLoadoutsTab) == IDC_buttonSharedLoadouts}) then { private _dataToCheck = _playerName + _loadoutName; @@ -52,7 +52,7 @@ GVAR(lastSearchTextLoadouts) = ""; params ["_contentPanelCtrl" ,"_loadoutArgs"]; _loadoutArgs params ["_playerName", "_loadoutName", "_loadoutData"]; - if (!(isNil QGVAR(currentLoadoutsTab)) && {GVAR(currentLoadoutsTab) == IDC_buttonSharedLoadouts}) then { + if ((!isNil QGVAR(currentLoadoutsTab)) && {GVAR(currentLoadoutsTab) == IDC_buttonSharedLoadouts}) then { private _curSelData =_contentPanelCtrl lnbData [(lnbCurSelRow _contentPanelCtrl), 1]; ([_loadoutData] call FUNC(verifyLoadout)) params ["_loadout", "_nullItemsAmount", "_unavailableItemsAmount"]; diff --git a/addons/arsenal/functions/fnc_fillLeftPanel.sqf b/addons/arsenal/functions/fnc_fillLeftPanel.sqf index 5009f46e3a..a662b91eb1 100644 --- a/addons/arsenal/functions/fnc_fillLeftPanel.sqf +++ b/addons/arsenal/functions/fnc_fillLeftPanel.sqf @@ -18,7 +18,7 @@ params ["_display", "_control"]; private _ctrlIDC = ctrlIDC _control; -if !(isNil QGVAR(currentLeftPanel)) then { +if (!isNil QGVAR(currentLeftPanel)) then { private _previousCtrlBackground = _display displayCtrl (GVAR(currentLeftPanel) - 1); _previousCtrlBackground ctrlSetFade 1; _previousCtrlBackground ctrlCommit FADE_DELAY; diff --git a/addons/arsenal/functions/fnc_fillRightPanel.sqf b/addons/arsenal/functions/fnc_fillRightPanel.sqf index 626afecc3d..e683c82d01 100644 --- a/addons/arsenal/functions/fnc_fillRightPanel.sqf +++ b/addons/arsenal/functions/fnc_fillRightPanel.sqf @@ -19,7 +19,7 @@ params ["_display", "_control"]; private _ctrlIDC = ctrlIDC _control; // Fade old control background -if !(isNil QGVAR(currentRightPanel)) then { +if (!isNil QGVAR(currentRightPanel)) then { private _previousCtrlBackground = _display displayCtrl (GVAR(currentRightPanel) - 1); _previousCtrlBackground ctrlSetFade 1; _previousCtrlBackground ctrlCommit FADE_DELAY; diff --git a/addons/arsenal/functions/fnc_handleStats.sqf b/addons/arsenal/functions/fnc_handleStats.sqf index 0c57f6c721..26597716ea 100644 --- a/addons/arsenal/functions/fnc_handleStats.sqf +++ b/addons/arsenal/functions/fnc_handleStats.sqf @@ -46,7 +46,7 @@ private _hideUnusedFnc = { } forEach _numbers; }; -if !(isNil "_itemCfg") then { +if (!isNil "_itemCfg") then { private _handleStatsFnc = { params ["_statsIndex", "_leftPanel"]; diff --git a/addons/arsenal/functions/fnc_message.sqf b/addons/arsenal/functions/fnc_message.sqf index 8fbd48748f..f3e6abb3e6 100644 --- a/addons/arsenal/functions/fnc_message.sqf +++ b/addons/arsenal/functions/fnc_message.sqf @@ -19,7 +19,7 @@ params ["_display", "_message"]; private _messageBoxCtrl = _display displayCtrl IDC_message; private _handle = _messageBoxCtrl getVariable QGVAR(messageBoxHandle); -if !(isNil "_handle") then { +if (!isNil "_handle") then { terminate _handle; }; diff --git a/addons/arsenal/functions/fnc_onSelChangedLeft.sqf b/addons/arsenal/functions/fnc_onSelChangedLeft.sqf index 2322853e1a..a314a34965 100644 --- a/addons/arsenal/functions/fnc_onSelChangedLeft.sqf +++ b/addons/arsenal/functions/fnc_onSelChangedLeft.sqf @@ -23,10 +23,10 @@ private _display = ctrlParent _control; private _item = [_control lnbData [_curSel, 0], _control lbData _curSel] select !(ctrlType _control == 102); private _weaponDefaultRightPanel = _display displayCtrl IDC_buttonOptic; -private _selectCorrectPanelWeapon = [_weaponDefaultRightPanel, _display displayCtrl GVAR(currentRightPanel)] select (!(isNil QGVAR(currentRightPanel)) && {GVAR(currentRightPanel) in [RIGHT_PANEL_ACC_IDCS, IDC_buttonCurrentMag, IDC_buttonCurrentMag2]}); +private _selectCorrectPanelWeapon = [_weaponDefaultRightPanel, _display displayCtrl GVAR(currentRightPanel)] select ((!isNil QGVAR(currentRightPanel)) && {GVAR(currentRightPanel) in [RIGHT_PANEL_ACC_IDCS, IDC_buttonCurrentMag, IDC_buttonCurrentMag2]}); private _containerDefaultRightPanel = _display displayCtrl IDC_buttonMisc; -private _selectCorrectPanelContainer = [_containerDefaultRightPanel, _display displayCtrl GVAR(currentRightPanel)] select (!(isNil QGVAR(currentRightPanel)) && {GVAR(currentRightPanel) in [RIGHT_PANEL_ITEMS_IDCS]}); +private _selectCorrectPanelContainer = [_containerDefaultRightPanel, _display displayCtrl GVAR(currentRightPanel)] select ((!isNil QGVAR(currentRightPanel)) && {GVAR(currentRightPanel) in [RIGHT_PANEL_ITEMS_IDCS]}); private _fnc_clearPreviousWepMags = { private _compatibleMags = getArray (configfile >> "cfgweapons" >> _baseWeapon >> "magazines"); diff --git a/addons/arsenal/functions/fnc_removeBox.sqf b/addons/arsenal/functions/fnc_removeBox.sqf index ed4ec7de4d..7620529ef3 100644 --- a/addons/arsenal/functions/fnc_removeBox.sqf +++ b/addons/arsenal/functions/fnc_removeBox.sqf @@ -23,7 +23,7 @@ if (isNull _object || {isNil QGVAR(EHIDArray)}) exitWith {}; if (_global && {isMultiplayer}) then { private _ID = (GVAR(EHIDArray) select {_x select 1 == _object}) select 0; - if !(isNil "_ID") then { + if (!isNil "_ID") then { [_ID select 0] call CBA_fnc_removeGlobalEventJIP; GVAR(EHIDArray) deleteAt (GVAR(EHIDArray) find _ID); publicVariable QGVAR(EHIDArray);