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

General - Utilize isNotEqualTo command #8732

Merged
merged 2 commits into from
Dec 18, 2021
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
10 changes: 5 additions & 5 deletions addons/common/functions/fnc_assignedItemFix.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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"];
Expand Down
2 changes: 1 addition & 1 deletion addons/cookoff/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion addons/cookoff/functions/fnc_cookOff.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion addons/cookoff/functions/fnc_smoke.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down
6 changes: 3 additions & 3 deletions addons/fire/functions/fnc_burn.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -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 {
Expand Down Expand Up @@ -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];
Expand Down
2 changes: 1 addition & 1 deletion addons/fire/functions/fnc_burnReaction.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion addons/fire/functions/fnc_fireManagerPFH.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down
6 changes: 3 additions & 3 deletions addons/headless/functions/fnc_transferGroups.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down
2 changes: 1 addition & 1 deletion addons/intelitems/functions/fnc_deleteControl.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};

Expand Down
2 changes: 1 addition & 1 deletion addons/interaction/functions/fnc_renameGroupUI.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion addons/markers/functions/fnc_initInsertMarker.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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];
};
Expand Down
2 changes: 1 addition & 1 deletion addons/markers/functions/fnc_placeMarker.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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, [
Expand Down
2 changes: 1 addition & 1 deletion addons/pylons/functions/fnc_onButtonApply.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion addons/tagging/functions/fnc_applyCustomTag.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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)
};

Expand Down
2 changes: 1 addition & 1 deletion addons/vehicle_damage/functions/fnc_processHit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion addons/viewrestriction/functions/fnc_canChangeCamera.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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} &&
Expand Down
4 changes: 2 additions & 2 deletions addons/viewrestriction/functions/fnc_switchPreserveView.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;