From af86109c2b3c9ec05d134561cf99691b84c832ff Mon Sep 17 00:00:00 2001 From: Serg Vergun <1197314+severgun@users.noreply.github.com> Date: Sun, 19 Dec 2021 02:15:32 +0300 Subject: [PATCH] General - Utilize `isNotEqualTo` command (#8732) * Utilize isNotEqualTo command * fix pr validation --- addons/common/functions/fnc_assignedItemFix.sqf | 10 +++++----- addons/cookoff/XEH_postInit.sqf | 2 +- addons/cookoff/functions/fnc_cookOff.sqf | 2 +- addons/cookoff/functions/fnc_smoke.sqf | 2 +- addons/fire/functions/fnc_burn.sqf | 6 +++--- addons/fire/functions/fnc_burnReaction.sqf | 2 +- addons/fire/functions/fnc_fireManagerPFH.sqf | 2 +- addons/headless/functions/fnc_transferGroups.sqf | 6 +++--- addons/intelitems/functions/fnc_deleteControl.sqf | 2 +- addons/interaction/functions/fnc_renameGroupUI.sqf | 2 +- addons/markers/functions/fnc_initInsertMarker.sqf | 2 +- addons/markers/functions/fnc_placeMarker.sqf | 2 +- addons/pylons/functions/fnc_onButtonApply.sqf | 2 +- addons/tagging/functions/fnc_applyCustomTag.sqf | 2 +- addons/vehicle_damage/functions/fnc_processHit.sqf | 2 +- .../viewrestriction/functions/fnc_canChangeCamera.sqf | 2 +- .../functions/fnc_switchPreserveView.sqf | 4 ++-- 17 files changed, 26 insertions(+), 26 deletions(-) diff --git a/addons/common/functions/fnc_assignedItemFix.sqf b/addons/common/functions/fnc_assignedItemFix.sqf index 3f523f4a59..444286eee3 100644 --- a/addons/common/functions/fnc_assignedItemFix.sqf +++ b/addons/common/functions/fnc_assignedItemFix.sqf @@ -37,11 +37,11 @@ GVAR(AssignedItemsShownItems) = [ private _assignedItems = getUnitLoadout _unit param [9, ["","","","","",""]]; // ["ItemMap","ItemGPS","ItemRadio","ItemCompass","ItemWatch","NVGoggles"] GVAR(AssignedItemsShownItems) = [ - !((_assignedItems select 0) isEqualTo "") && {getText (configFile >> "CfgWeapons" >> _assignedItems select 0 >> "ACE_hideItemType") != "map"}, - !((_assignedItems select 3) isEqualTo "") && {getText (configFile >> "CfgWeapons" >> _assignedItems select 3 >> "ACE_hideItemType") != "compass"}, - !((_assignedItems select 4) isEqualTo "") && {getText (configFile >> "CfgWeapons" >> _assignedItems select 4 >> "ACE_hideItemType") != "watch"}, - !((_assignedItems select 2) isEqualTo "") && {getText (configFile >> "CfgWeapons" >> _assignedItems select 2 >> "ACE_hideItemType") != "radio"}, - !((_assignedItems select 1) isEqualTo "") && {getText (configFile >> "CfgWeapons" >> _assignedItems select 1 >> "ACE_hideItemType") != "gps"} + ((_assignedItems select 0) isNotEqualTo "") && {getText (configFile >> "CfgWeapons" >> _assignedItems select 0 >> "ACE_hideItemType") != "map"}, + ((_assignedItems select 3) isNotEqualTo "") && {getText (configFile >> "CfgWeapons" >> _assignedItems select 3 >> "ACE_hideItemType") != "compass"}, + ((_assignedItems select 4) isNotEqualTo "") && {getText (configFile >> "CfgWeapons" >> _assignedItems select 4 >> "ACE_hideItemType") != "watch"}, + ((_assignedItems select 2) isNotEqualTo "") && {getText (configFile >> "CfgWeapons" >> _assignedItems select 2 >> "ACE_hideItemType") != "radio"}, + ((_assignedItems select 1) isNotEqualTo "") && {getText (configFile >> "CfgWeapons" >> _assignedItems select 1 >> "ACE_hideItemType") != "gps"} ]; GVAR(AssignedItemsShownItems) params ["_showMap", "_showCompass", "_showWatch", "_showRadio", "_showGPS"]; diff --git a/addons/cookoff/XEH_postInit.sqf b/addons/cookoff/XEH_postInit.sqf index e4a46c10a0..52073d39b1 100644 --- a/addons/cookoff/XEH_postInit.sqf +++ b/addons/cookoff/XEH_postInit.sqf @@ -15,7 +15,7 @@ params ["_vehicle", ["_effects", []]]; _effects = _effects + (_vehicle getVariable [QGVAR(effects), []]); - if !(_effects isEqualTo []) then { + if (_effects isNotEqualTo []) then { { deleteVehicle _x } count _effects; }; }] call CBA_fnc_addEventHandler; diff --git a/addons/cookoff/functions/fnc_cookOff.sqf b/addons/cookoff/functions/fnc_cookOff.sqf index 4fb1d751ff..8f1ee56bae 100644 --- a/addons/cookoff/functions/fnc_cookOff.sqf +++ b/addons/cookoff/functions/fnc_cookOff.sqf @@ -34,7 +34,7 @@ _vehicle setVariable [QGVAR(isCookingOff), true, true]; _intensity = _intensity min _maxIntensity; private _config = _vehicle call CBA_fnc_getObjectConfig; -private _positions = getArray (_config >> QGVAR(cookoffSelections)) select {!((_vehicle selectionPosition _x) isEqualTo [0,0,0])}; +private _positions = getArray (_config >> QGVAR(cookoffSelections)) select {(_vehicle selectionPosition _x) isNotEqualTo [0,0,0]}; if (_positions isEqualTo []) then { WARNING_1("no valid selection for cookoff found. %1",typeOf _vehicle); diff --git a/addons/cookoff/functions/fnc_smoke.sqf b/addons/cookoff/functions/fnc_smoke.sqf index de9e4c5d37..50ff7fe8aa 100644 --- a/addons/cookoff/functions/fnc_smoke.sqf +++ b/addons/cookoff/functions/fnc_smoke.sqf @@ -31,7 +31,7 @@ private _effects = [_smokeBarrel]; { private _position = [0, -2, 0]; - if !(_x isEqualTo "#noselection") then { + if (_x isNotEqualTo "#noselection") then { _position = _vehicle selectionPosition _x; }; diff --git a/addons/fire/functions/fnc_burn.sqf b/addons/fire/functions/fnc_burn.sqf index bf4709fd0d..78bc40007a 100644 --- a/addons/fire/functions/fnc_burn.sqf +++ b/addons/fire/functions/fnc_burn.sqf @@ -137,7 +137,7 @@ if (_isBurning) exitWith {}; }; // always keep flare visible to perceiving unit as long as it isnt the player - if !(_unit isEqualTo ace_player) then { + if (_unit isNotEqualTo ace_player) then { private _relativeAttachPoint = [0, 0, 0.3]; if (_distanceToUnit > 1.5) then { _relativeAttachPoint = (vectorNormalized (_unit worldToModelVisual (getPos ace_player))) vectorMultiply linearConversion [5, 30, _distanceToUnit, 0.5, 1.5]; @@ -162,7 +162,7 @@ if (_isBurning) exitWith {}; [QGVAR(burn), [ace_player, _intensity * (7 / 8), _instigator]] call CBA_fnc_globalEvent; }; } else { - if ((ace_player isKindOf "Man") && { !(_unit isEqualTo ace_player) }) then { + if ((ace_player isKindOf "Man") && {_unit isNotEqualTo ace_player}) then { private _burnCounter = ace_player getVariable [QGVAR(burnCounter), 0]; if (_distanceToUnit < BURN_PROPOGATE_DISTANCE) then { if (_burnCounter < BURN_PROPOGATE_COUNTER_MAX) then { @@ -279,7 +279,7 @@ if (_isBurning) exitWith {}; _lightFlare setLightFlareMaxDistance 100; _lightFlare setLightFlareSize 0; - if !(_unit isEqualTo ace_player) then { + if (_unit isNotEqualTo ace_player) then { private _relativeAttachPoint = (vectorNormalized (_unit worldToModelVisual (getPos ace_player))) vectorMultiply 1; _relativeAttachPoint set [2, 0.5]; _lightFlare attachTo [_unit, _relativeAttachPoint]; diff --git a/addons/fire/functions/fnc_burnReaction.sqf b/addons/fire/functions/fnc_burnReaction.sqf index a79875a24b..e7bef91dbc 100644 --- a/addons/fire/functions/fnc_burnReaction.sqf +++ b/addons/fire/functions/fnc_burnReaction.sqf @@ -18,7 +18,7 @@ params ["_unit", ["_throwWeapon", true]]; if ( _throwWeapon && {GVAR(dropWeapon) > 0} - && {_unit in _unit && { !(currentWeapon _unit isEqualTo "") }} + && {_unit in _unit && {(currentWeapon _unit) isNotEqualTo ""}} && {!isPlayer _unit || GVAR(dropWeapon >= 2)} ) then { [_unit] call EFUNC(hitreactions,throwWeapon); diff --git a/addons/fire/functions/fnc_fireManagerPFH.sqf b/addons/fire/functions/fnc_fireManagerPFH.sqf index f52d5f31d5..fa2c0ea8f3 100644 --- a/addons/fire/functions/fnc_fireManagerPFH.sqf +++ b/addons/fire/functions/fnc_fireManagerPFH.sqf @@ -28,7 +28,7 @@ params ["_args", "_handle"]; _value params ["_source", "_radius", "_intensity"]; private _attachedObject = attachedTo _source; private _sourcePos = getPosATL _source; - if !(_attachedObject isEqualTo objNull) then { + if (_attachedObject isNotEqualTo objNull) then { _sourcePos = getPosATL _attachedObject; }; diff --git a/addons/headless/functions/fnc_transferGroups.sqf b/addons/headless/functions/fnc_transferGroups.sqf index 94cd2627d4..6918c8e23d 100644 --- a/addons/headless/functions/fnc_transferGroups.sqf +++ b/addons/headless/functions/fnc_transferGroups.sqf @@ -65,11 +65,11 @@ private _numTransferredHC3 = 0; // Transfer AI groups { // No transfer if empty group - private _transfer = !(units _x isEqualTo []) && {!(_x getVariable [QXGVAR(blacklist), false])}; + private _transfer = ((units _x) isNotEqualTo []) && {!(_x getVariable [QXGVAR(blacklist), false])}; if (_transfer) then { // No transfer if waypoints with synchronized triggers exist for the group - private _allWaypointsWithTriggers = (waypoints _x) select {!((synchronizedTriggers _x) isEqualTo [])}; - if !(_allWaypointsWithTriggers isEqualTo []) exitWith { + private _allWaypointsWithTriggers = (waypoints _x) select {(synchronizedTriggers _x) isNotEqualTo []}; + if (_allWaypointsWithTriggers isNotEqualTo []) exitWith { _transfer = false; }; diff --git a/addons/intelitems/functions/fnc_deleteControl.sqf b/addons/intelitems/functions/fnc_deleteControl.sqf index 8c93f85fa6..858044715f 100644 --- a/addons/intelitems/functions/fnc_deleteControl.sqf +++ b/addons/intelitems/functions/fnc_deleteControl.sqf @@ -27,7 +27,7 @@ ctrlPosition _controlsGroup params ["_posX", "_posY"]; private _ctrlContent = _controlsGroup controlsGroupCtrl IDC_CONTENT; private _data = ctrlText _ctrlContent; -if !(_data isEqualTo GET_DATA(_index)) then { +if (_data isNotEqualTo GET_DATA(_index)) then { SET_DATA(_index,_data); }; diff --git a/addons/interaction/functions/fnc_renameGroupUI.sqf b/addons/interaction/functions/fnc_renameGroupUI.sqf index e9b46d0f83..2fdac954e1 100644 --- a/addons/interaction/functions/fnc_renameGroupUI.sqf +++ b/addons/interaction/functions/fnc_renameGroupUI.sqf @@ -26,7 +26,7 @@ _display displayAddEventHandler ["Unload", { params ["_display", "_exitCode"]; - if !(_exitCode isEqualTo 1) exitWith {}; + if (_exitCode isNotEqualTo 1) exitWith {}; private _group = _display getVariable QGVAR(renamedGroup); private _textCtrl = _display displayCtrl 451; diff --git a/addons/markers/functions/fnc_initInsertMarker.sqf b/addons/markers/functions/fnc_initInsertMarker.sqf index 2aa7a0155e..2a900f2241 100644 --- a/addons/markers/functions/fnc_initInsertMarker.sqf +++ b/addons/markers/functions/fnc_initInsertMarker.sqf @@ -343,7 +343,7 @@ // init marker scale slider _aceScaleSlider sliderSetRange [0.5, 2.0]; - if !(GVAR(editingMarker) isEqualTo "") then { + if (GVAR(editingMarker) isNotEqualTo "") then { //get the original scale GVAR(currentMarkerScale) = (markerSize GVAR(editingMarker)) param [0, 1]; }; diff --git a/addons/markers/functions/fnc_placeMarker.sqf b/addons/markers/functions/fnc_placeMarker.sqf index 77942343ad..8db947d0b8 100644 --- a/addons/markers/functions/fnc_placeMarker.sqf +++ b/addons/markers/functions/fnc_placeMarker.sqf @@ -51,7 +51,7 @@ if (_closeNum isEqualTo 1) then { // Add to list of user placed markers, and then filter for deleted GVAR(userPlacedMarkers) pushBack _newestMarker; - GVAR(userPlacedMarkers) = GVAR(userPlacedMarkers) select {!((getMarkerPos _x) isEqualTo [0,0,0])}; + GVAR(userPlacedMarkers) = GVAR(userPlacedMarkers) select {(getMarkerPos _x) isNotEqualTo [0,0,0]}; [QGVAR(setMarkerNetwork), [ _newestMarker, [ diff --git a/addons/pylons/functions/fnc_onButtonApply.sqf b/addons/pylons/functions/fnc_onButtonApply.sqf index 5603ed8d94..3fb802d90b 100644 --- a/addons/pylons/functions/fnc_onButtonApply.sqf +++ b/addons/pylons/functions/fnc_onButtonApply.sqf @@ -17,7 +17,7 @@ // Check for FRIES change private _checkbox = CONTROL(ID_DIALOG) ID_CHECKBOX_FRIES; -if (ctrlShown _checkbox && {!((cbChecked _checkbox) isEqualTo (_checkbox getVariable QGVAR(originalState)))}) then { +if (ctrlShown _checkbox && {(cbChecked _checkbox) isNotEqualTo (_checkbox getVariable QGVAR(originalState))}) then { if (cbChecked _checkbox) then { [GVAR(currentAircraft)] call EFUNC(fastroping,equipFRIES); } else { diff --git a/addons/tagging/functions/fnc_applyCustomTag.sqf b/addons/tagging/functions/fnc_applyCustomTag.sqf index 63ae9836ac..140747d067 100644 --- a/addons/tagging/functions/fnc_applyCustomTag.sqf +++ b/addons/tagging/functions/fnc_applyCustomTag.sqf @@ -24,7 +24,7 @@ params ["_identifier", "_displayName", "_requiredItem"]; // Add only if tag not already added (compare identifiers) -if !(GVAR(cachedTags) select {_x select 0 == _identifier} isEqualTo []) exitWith { +if ((GVAR(cachedTags) select {_x select 0 == _identifier}) isNotEqualTo []) exitWith { INFO_2("Tag with selected identifier already exists: %1 (%2)",_identifier,_displayName) }; diff --git a/addons/vehicle_damage/functions/fnc_processHit.sqf b/addons/vehicle_damage/functions/fnc_processHit.sqf index d548eed5a3..fd58fda181 100644 --- a/addons/vehicle_damage/functions/fnc_processHit.sqf +++ b/addons/vehicle_damage/functions/fnc_processHit.sqf @@ -146,7 +146,7 @@ private _chanceOfDetonation = 0; private _explosiveAmmoCount = 0; private _nonExplosiveAmmoCount = 0; -if !(count (_currentVehicleAmmo select 0) isEqualTo 0) then { +if (count (_currentVehicleAmmo select 0) isNotEqualTo 0) then { private _magConfig = configFile >> "CfgMagazines"; private _ammoConfig = configFile >> "CfgAmmo"; private _countOfExplodableAmmo = 0; diff --git a/addons/viewrestriction/functions/fnc_canChangeCamera.sqf b/addons/viewrestriction/functions/fnc_canChangeCamera.sqf index 9114a23303..d037d2f095 100644 --- a/addons/viewrestriction/functions/fnc_canChangeCamera.sqf +++ b/addons/viewrestriction/functions/fnc_canChangeCamera.sqf @@ -22,7 +22,7 @@ params ["_newCameraView", "_cameraOn", ["_checkGunnerView", true]]; // Remote control hates switchCamera (control returns to player, camera is left on remotely controlled object/unit), make sure remote controlled units are not impacted !(_newCameraView isEqualTo "GUNNER" && {_checkGunnerView}) && -{!(_newCameraView isEqualTo "GROUP")} && +{_newCameraView isNotEqualTo "GROUP"} && {!isNull ACE_player} && {player == ACE_player} && {alive ACE_player} && diff --git a/addons/viewrestriction/functions/fnc_switchPreserveView.sqf b/addons/viewrestriction/functions/fnc_switchPreserveView.sqf index 6de1b5b135..722de4ea37 100644 --- a/addons/viewrestriction/functions/fnc_switchPreserveView.sqf +++ b/addons/viewrestriction/functions/fnc_switchPreserveView.sqf @@ -32,7 +32,7 @@ GVAR(preserveViewCameraViewEH) = ["cameraView", { private _vehicle = vehicle _player; private _vehicleClass = {if (_vehicle isKindOf _x) exitWith {_x}} forEach ["CAManBase", "LandVehicle", "Air", "Ship", "All"]; private _varName = QXGVAR(preserveView) + _vehicleClass; - if !(_cameraView isEqualTo (profileNamespace getVariable [_varName, ""])) then { + if (_cameraView isNotEqualTo (profileNamespace getVariable [_varName, ""])) then { profileNamespace setVariable [_varName, _cameraView]; }; }] call CBA_fnc_addPlayerEventHandler; @@ -44,7 +44,7 @@ GVAR(preserveViewVehicleEH) = ["vehicle", { private _vehicleClass = {if (_vehicle isKindOf _x) exitWith {_x}} forEach ["CAManBase", "LandVehicle", "Air", "Ship", "All"]; private _savedView = profileNamespace getVariable (QXGVAR(preserveView) + _vehicleClass); - if (!isNil "_savedView" && {!(_cameraView isEqualTo _savedView)}) then { + if (!isNil "_savedView" && {_cameraView isNotEqualTo _savedView}) then { _vehicle switchCamera _savedView; }; }, true] call CBA_fnc_addPlayerEventHandler;