Skip to content

Commit

Permalink
Merge pull request #1376 from Neviothr/dev_isNotEqualTo
Browse files Browse the repository at this point in the history
Utilize isNotEqualTo
  • Loading branch information
PabstMirror authored Feb 23, 2021
2 parents 450ad36 + 11cc07e commit 609d85e
Show file tree
Hide file tree
Showing 38 changed files with 78 additions and 78 deletions.
4 changes: 2 additions & 2 deletions addons/accessory/fnc_switchAttachment.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ private _configs = if (_switchTo == "next") then {
} else {
configProperties [__currItem, "configName _x == 'MRT_SwitchItemPrevClass'", false];
};
if (!(_configs isEqualTo [])) then {
if (_configs isNotEqualTo []) then {
_switchItem = getText (_configs select 0);
};
TRACE_3("",_currItem,_switchTo,_switchItem);
Expand Down Expand Up @@ -83,7 +83,7 @@ if (!isNil "_switchItem") then {
};
private _switchItemHintText = getText (__cfgWeapons >> _switchItem >> "MRT_SwitchItemHintText");
private _switchItemHintImage = getText (__cfgWeapons >> _switchItem >> "picture");
if !(_switchItemHintText isEqualTo "") then {
if (_switchItemHintText isNotEqualTo "") then {
[[_switchItemHintImage, 2.0], [_switchItemHintText], true] call CBA_fnc_notify;
};
playSound "click";
Expand Down
2 changes: 1 addition & 1 deletion addons/ai/fnc_clearWaypoints.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ private _waypoints = waypoints _group;
deleteWaypoint [_group, 0];
} forEach _waypoints;

if !(units _group isEqualTo []) then {
if (units _group isNotEqualTo []) then {
// Create a self-deleting waypoint at the leader position to halt all planned movement (based on old waypoints)
private _wp = _group addWaypoint [getPosASL leader _group, -1];
_wp setWaypointStatements ["true", "deleteWaypoint [group this, currentWaypoint (group this)]"];
Expand Down
2 changes: 1 addition & 1 deletion addons/ai/fnc_searchNearby.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ if ((leader _group) distanceSqr _building > 250e3) exitwith {};

// Search while there are still available positions
private _positions = _building buildingPos -1;
while {!(_positions isEqualTo [])} do {
while {_positions isNotEqualTo []} do {
// Update units in case of death
private _units = (units _group) - [_leader];

Expand Down
4 changes: 2 additions & 2 deletions addons/ai/fnc_taskDefend.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ if (_patrol > 0 && {count _units > 1}) then {

{
// 31% chance to occupy nearest free static weapon
if ((random 1 < 0.31) && { !(_statics isEqualto []) }) then {
if ((random 1 < 0.31) && {_statics isNotEqualTo []}) then {
_x assignAsGunner (_statics deleteAt 0);
[_x] orderGetIn true;
} else {
Expand All @@ -91,7 +91,7 @@ if (_patrol > 0 && {count _units > 1}) then {
private _building = selectRandom _buildings;
private _array = _building getVariable ["CBA_taskDefend_positions", []];

if !(_array isEqualTo []) then {
if (_array isNotEqualTo []) then {
private _pos = _array deleteAt (floor (random (count _array)));

// If building positions are all taken remove from possible buildings
Expand Down
2 changes: 1 addition & 1 deletion addons/common/fnc_getArea.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if (_zRef isEqualType "") then {
} else {
if (_zRef isEqualType objNull) then {
// Validate that object is a trigger
if !((triggerArea _zRef) isEqualTo []) then {
if ((triggerArea _zRef) isNotEqualTo []) then {
_area pushBack (getPos _zRef);
_area append (triggerArea _zRef);
_area resize 5;
Expand Down
2 changes: 1 addition & 1 deletion addons/common/fnc_headDir.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ if (_unit != call CBA_fnc_currentUnit) then {

private _diff = -_azimuth;

if !(_offset isEqualTo "") then {
if (_offset isNotEqualTo "") then {
ADD(_diff,_unit getDir ([_offset] call CBA_fnc_getPos));
};

Expand Down
2 changes: 1 addition & 1 deletion addons/diagnostic/fnc_initExtendedDebugConsole.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ FUNC(logStatement) = {
private _statementIndex = profileNamespace getVariable [QGVAR(statementIndex), 0];
private _prevStatements = profileNamespace getVariable [QGVAR(statements), []];

if !((_prevStatements param [0, ""]) isEqualTo _statement) then {
if ((_prevStatements param [0, ""]) isNotEqualTo _statement) then {
_prevStatements deleteAt (_prevStatements find _statement);

// pushFront
Expand Down
2 changes: 1 addition & 1 deletion addons/events/fnc_addMarkerEventHandler.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if (isNil QGVAR(oldMarkers)) then {

[{
private _newAllMapMarkers = allMapMarkers;
if !(_newAllMapMarkers isEqualTo GVAR(oldMarkers)) then {
if (_newAllMapMarkers isNotEqualTo GVAR(oldMarkers)) then {
params ["_events"];

{
Expand Down
6 changes: 3 additions & 3 deletions addons/events/fnc_addPlayerEventHandler.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ if (_id != -1) then {
SCRIPT(playerEvent_Map);

params ["_data"]; // visibleMap is updated one frame later
if !(_data isEqualTo GVAR(oldVisibleMap)) then {
if (_data isNotEqualTo GVAR(oldVisibleMap)) then {
GVAR(oldVisibleMap) = _data;
[QGVAR(visibleMapEvent), [call CBA_fnc_currentUnit, _data]] call CBA_fnc_localEvent;
};
Expand All @@ -180,7 +180,7 @@ if (_id != -1) then {
0 spawn {
{
private _data = visibleMap;
if !(_data isEqualTo GVAR(oldVisibleMap)) then {
if (_data isNotEqualTo GVAR(oldVisibleMap)) then {
GVAR(oldVisibleMap) = _data;
[QGVAR(visibleMapEvent), [call CBA_fnc_currentUnit, _data]] call CBA_fnc_localEvent;
};
Expand All @@ -191,7 +191,7 @@ if (_id != -1) then {
SCRIPT(playerEH_featureCamera);

private _data = call CBA_fnc_getActiveFeatureCamera;
if !(_data isEqualTo GVAR(oldFeatureCamera)) then {
if (_data isNotEqualTo GVAR(oldFeatureCamera)) then {
GVAR(oldFeatureCamera) = _data;
[QGVAR(featureCameraEvent), [call CBA_fnc_currentUnit, _data]] call CBA_fnc_localEvent;
};
Expand Down
30 changes: 15 additions & 15 deletions addons/events/fnc_playerEvent.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ private _state = [
currentVisionMode _controlledEntity, cameraView
];

if !(_state isEqualTo GVAR(oldState)) then {
if (_state isNotEqualTo GVAR(oldState)) then {
GVAR(oldState) = _state;

_state params [
Expand All @@ -63,77 +63,77 @@ if !(_state isEqualTo GVAR(oldState)) then {
_newMuzzle = [_unit, _newWeapon, _newMuzzle];
_newWeaponMode = [_unit, _newMuzzle, _newWeaponMode];

if !(_unit isEqualTo GVAR(oldUnit)) then {
if (_unit isNotEqualTo GVAR(oldUnit)) then {
[QGVAR(unitEvent), [_unit, GVAR(oldUnit)]] call CBA_fnc_localEvent;
GVAR(oldUnit) = _unit;
};

if !(_newGroup isEqualTo GVAR(oldGroup)) then {
if (_newGroup isNotEqualTo GVAR(oldGroup)) then {
[QGVAR(groupEvent), [_unit, GVAR(oldGroup), _newGroup]] call CBA_fnc_localEvent; // intentionally reversed order for backwards compatiblity
GVAR(oldGroup) = _newGroup;
};

if !(_newLeader isEqualTo GVAR(oldLeader)) then {
if (_newLeader isNotEqualTo GVAR(oldLeader)) then {
[QGVAR(leaderEvent), [_unit, GVAR(oldLeader), _newLeader]] call CBA_fnc_localEvent; // intentionally reversed order for backwards compatiblity
GVAR(oldLeader) = _newLeader;
};

if !(_newWeapon isEqualTo GVAR(oldWeapon)) then {
if (_newWeapon isNotEqualTo GVAR(oldWeapon)) then {
[QGVAR(weaponEvent), [_unit, _newWeapon, GVAR(oldWeapon)]] call CBA_fnc_localEvent;
GVAR(oldWeapon) = _newWeapon;
};

if !(_newTurretWeapon isEqualTo GVAR(oldTurretWeapon)) then {
if (_newTurretWeapon isNotEqualTo GVAR(oldTurretWeapon)) then {
[QGVAR(turretWeaponEvent), [_unit, _newTurretWeapon, GVAR(oldTurretWeapon)]] call CBA_fnc_localEvent;
GVAR(oldTurretWeapon) = _newTurretWeapon;
};

if !(_newMuzzle isEqualTo GVAR(oldMuzzle)) then {
if (_newMuzzle isNotEqualTo GVAR(oldMuzzle)) then {
[QGVAR(muzzleEvent), [_newMuzzle select 2, GVAR(oldMuzzle) select 2]] call CBA_fnc_localEvent;
GVAR(oldMuzzle) = _newMuzzle;
};

if !(_newWeaponMode isEqualTo GVAR(oldWeaponMode)) then {
if (_newWeaponMode isNotEqualTo GVAR(oldWeaponMode)) then {
[QGVAR(weaponModeEvent), [_unit, _newWeaponMode select 2, GVAR(oldWeaponMode) select 2]] call CBA_fnc_localEvent;
GVAR(oldWeaponMode) = _newWeaponMode;
};

if !(_newLoadout isEqualTo GVAR(oldLoadout)) then {
if (_newLoadout isNotEqualTo GVAR(oldLoadout)) then {
// We don't want to trigger this just because your ammo counter decreased.
private _newLoadoutNoAmmo = + _newLoadout;

{
private _weaponInfo = _newLoadoutNoAmmo param [_forEachIndex, []];
if !(_weaponInfo isEqualTo []) then {
if (_weaponInfo isNotEqualTo []) then {
_weaponInfo set [4, _x];
_weaponInfo deleteAt 5;
};
} forEach [primaryWeaponMagazine _unit, secondaryWeaponMagazine _unit, handgunMagazine _unit];

if !(_newLoadoutNoAmmo isEqualTo GVAR(oldLoadoutNoAmmo)) then {
if (_newLoadoutNoAmmo isNotEqualTo GVAR(oldLoadoutNoAmmo)) then {
[QGVAR(loadoutEvent), [_unit, _newLoadout, GVAR(oldLoadout)]] call CBA_fnc_localEvent;
GVAR(oldLoadoutNoAmmo) = _newLoadoutNoAmmo;
};

GVAR(oldLoadout) = _newLoadout;
};

if !(_vehicle isEqualTo GVAR(oldVehicle)) then {
if (_vehicle isNotEqualTo GVAR(oldVehicle)) then {
[QGVAR(vehicleEvent), [_unit, _vehicle, GVAR(oldVehicle)]] call CBA_fnc_localEvent;
GVAR(oldVehicle) = _vehicle;
};

if !(_turret isEqualTo GVAR(oldTurret)) then {
if (_turret isNotEqualTo GVAR(oldTurret)) then {
[QGVAR(turretEvent), [_unit, _turret, GVAR(oldTurret)]] call CBA_fnc_localEvent;
GVAR(oldTurret) = _turret;
};

if !(_newVisionMode isEqualTo GVAR(oldVisionMode)) then {
if (_newVisionMode isNotEqualTo GVAR(oldVisionMode)) then {
[QGVAR(visionModeEvent), [_unit, _newVisionMode, GVAR(oldVisionMode)]] call CBA_fnc_localEvent;
GVAR(oldVisionMode) = _newVisionMode;
};

if !(_newCameraView isEqualTo GVAR(oldCameraView)) then {
if (_newCameraView isNotEqualTo GVAR(oldCameraView)) then {
[QGVAR(cameraViewEvent), [_unit, _newCameraView, GVAR(oldCameraView)]] call CBA_fnc_localEvent;
GVAR(oldCameraView) = _newCameraView; // This assignment may be returned.
};
Expand Down
2 changes: 1 addition & 1 deletion addons/events/fnc_removeEventHandler.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ params [["_eventName", "", [""]], ["_eventId", -1, [0]]];

// decrement all higher internal ids, to adjust to new array position, _key == _eventId, _value == _internalId
[_eventHash, {
if (_value > _internalId && {!(_key isEqualTo "#lastId")}) then {
if (_value > _internalId && {_key isNotEqualTo "#lastId"}) then {
[_eventHash, _key, _value - 1] call CBA_fnc_hashSet;
};
}] call CBA_fnc_hashEachPair;
Expand Down
4 changes: 2 additions & 2 deletions addons/events/fnc_userKeyHandler.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ private _userKeyStates = [
inputAction "User16" > 0.1, inputAction "User17" > 0.1, inputAction "User18" > 0.1, inputAction "User19" > 0.1, inputAction "User20" > 0.1
];

if !(_userKeyStates isEqualTo GVAR(userKeyStates)) then {
if (_userKeyStates isNotEqualTo GVAR(userKeyStates)) then {
{
if !(_x isEqualTo (GVAR(userKeyStates) select _forEachIndex)) then {
if (_x isNotEqualTo (GVAR(userKeyStates) select _forEachIndex)) then {
GVAR(userKeyStates) set [_forEachIndex, _x];
[_display, USERACTION_OFFSET + _forEachIndex, false, false, false] call ([FUNC(keyHandlerUp), FUNC(keyHandlerDown)] select _x);
};
Expand Down
4 changes: 2 additions & 2 deletions addons/hashes/fnc_parseJSON.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ private _reduce = {
private _array = [];

// Empty arrays need special handling
if !(_parseStack#(count _parseStack - 2) isEqualTo "[") then {
if (_parseStack#(count _parseStack - 2) isNotEqualTo "[") then {
// Get next token, if [ beginning is reached, otherwise assume
// valid JSON and that the token is a comma
while {_parseStack deleteAt (count _parseStack - 1) != "["} do {
Expand Down Expand Up @@ -200,7 +200,7 @@ private _reduce = {
private _object = [] call _createObject;

// Empty objects need special handling
if !(_parseStack#(count _parseStack - 2) isEqualTo "{") then {
if (_parseStack#(count _parseStack - 2) isNotEqualTo "{") then {
// Get next token, if { beginning is reached, otherwise assume
// valid JSON and that token is comma
while {_parseStack deleteAt (count _parseStack - 1) != "{"} do {
Expand Down
8 changes: 4 additions & 4 deletions addons/keybinding/fnc_addKeybind.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,11 @@ if (_defaultKeybind isEqualTypeParams [0, false, false, false]) then {

// Handle non-code type being passed for up/down code args
if (!(_downCode isEqualType {})) then {
if (!(_downCode isEqualTo "")) then {WARNING_1("_downCode: Non code type [%1] will be ignored",_downCode);};
if (_downCode isNotEqualTo "") then {WARNING_1("_downCode: Non code type [%1] will be ignored",_downCode);};
_downCode = {};
};
if (!(_upCode isEqualType {})) then {
if (!(_upCode isEqualTo "")) then {WARNING_1("_upCode: Non code type [%1] will be ignored",_upCode);};
if (_upCode isNotEqualTo "") then {WARNING_1("_upCode: Non code type [%1] will be ignored",_upCode);};
_upCode = {};
};

Expand Down Expand Up @@ -184,11 +184,11 @@ GVAR(actions) setVariable [_action, [_displayName, _tooltip, _keybinds, _default
{
_keybind = _x;

if !(_downCode isEqualTo {}) then {
if (_downCode isNotEqualTo {}) then {
[_keybind select 0, _keybind select 1, _downCode, "keyDown", format ["%1_down_%2", _action, _forEachIndex], _holdKey, _holdDelay] call CBA_fnc_addKeyHandler;
};

if !(_upCode isEqualTo {}) then {
if (_upCode isNotEqualTo {}) then {
[_keybind select 0, _keybind select 1, _upCode, "keyUp", format ["%1_up_%2", _action, _forEachIndex]] call CBA_fnc_addKeyHandler;
};
} forEach _keybinds;
Expand Down
4 changes: 2 additions & 2 deletions addons/keybinding/fnc_initDisplayConfigure.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ _ctrlButtonOK ctrlAddEventHandler ["ButtonClick", {
{
_keybind = _x;

if !(_downCode isEqualTo {}) then {
if (_downCode isNotEqualTo {}) then {
[_keybind select 0, _keybind select 1, _downCode, "keyDown", format ["%1_down_%2", _action, _forEachIndex], _holdKey, _holdDelay] call CBA_fnc_addKeyHandler;
};

if !(_upCode isEqualTo {}) then {
if (_upCode isNotEqualTo {}) then {
[_keybind select 0, _keybind select 1, _upCode, "keyUp", format ["%1_up_%2", _action, _forEachIndex]] call CBA_fnc_addKeyHandler;
};
} forEach _keybinds;
Expand Down
2 changes: 1 addition & 1 deletion addons/optics/fnc_animateScriptedOptic.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ _ctrlMagnification ctrlShow _isUsingOptic;

GVAR(ppEffects) ppEffectEnable _isUsingOptic;

if !(_isUsingOptic isEqualTo GVAR(IsUsingOptic)) then {
if (_isUsingOptic isNotEqualTo GVAR(IsUsingOptic)) then {
GVAR(IsUsingOptic) = _isUsingOptic;
[QGVAR(UsingOptic), [_display, _isUsingOptic]] call CBA_fnc_localEvent;
};
Expand Down
2 changes: 1 addition & 1 deletion addons/optics/fnc_updateOpticInfo.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ GVAR(hidePeripheralVision) = getNumber (_config >> "hidePeripheralVision") != 0;
// zeroing distances
configProperties [configFile >> "CfgWeapons" >> _optic >> "ItemInfo" >> "OpticsModes"] findIf {
GVAR(ZeroingDistances) = getArray (_x >> "discreteDistance");
!(GVAR(ZeroingDistances) isEqualTo [])
(GVAR(ZeroingDistances) isNotEqualTo [])
};

// pp effects
Expand Down
2 changes: 1 addition & 1 deletion addons/settings/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
private _presetsHash = profileNamespace getVariable [QGVAR(presetsHash), HASH_NULL];
private _autosavedPresets = profileNamespace getVariable [QGVAR(autosavedPresets), [[],[]]];

if !(allVariables GVAR(mission) isEqualTo []) then {
if (allVariables GVAR(mission) isNotEqualTo []) then {
private _preset = "mission" call FUNC(export);
private _presetName = format ["Autosave: %1 (%2)", LLSTRING(ButtonMission), missionName];

Expand Down
2 changes: 1 addition & 1 deletion addons/settings/fnc_export.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private _temp = [];
};

if (_exportDefault || {
!(_value isEqualTo _defaultValue) ||
_value isNotEqualTo _defaultValue ||
SANITIZE_PRIORITY(_setting,_priority,_source) > SANITIZE_PRIORITY(_setting,0,_source)
}) then {
_temp pushBack [_category, _setting, _value, _priority];
Expand Down
4 changes: 2 additions & 2 deletions addons/settings/fnc_gui_settingCheckbox.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ _ctrlCheckbox ctrlAddEventHandler ["CheckedChanged", {
private _controlsGroup = ctrlParentControlsGroup _ctrlCheckbox;
private _ctrlDefault = _controlsGroup controlsGroupCtrl IDC_SETTING_DEFAULT;
private _defaultValue = [_setting, "default"] call FUNC(get);
_ctrlDefault ctrlEnable !(_value isEqualTo _defaultValue);
_ctrlDefault ctrlEnable (_value isNotEqualTo _defaultValue);

// automatically check "overwrite client" for mission makers qol
[_controlsGroup, _source] call (_controlsGroup getVariable QFUNC(auto_check_overwrite));
Expand All @@ -35,5 +35,5 @@ _controlsGroup setVariable [QFUNC(updateUI), {
// if new value is same as default value, grey out the default button
private _ctrlDefault = _controlsGroup controlsGroupCtrl IDC_SETTING_DEFAULT;
private _defaultValue = [_setting, "default"] call FUNC(get);
_ctrlDefault ctrlEnable !(_value isEqualTo _defaultValue);
_ctrlDefault ctrlEnable (_value isNotEqualTo _defaultValue);
}];
8 changes: 4 additions & 4 deletions addons/settings/fnc_gui_settingColor.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ for "_index" from 0 to ((count _currentValue max 3 min 4) - 1) do {
// if new value is same as default value, grey out the default button
private _ctrlDefault = _controlsGroup controlsGroupCtrl IDC_SETTING_DEFAULT;
private _defaultValue = [_setting, "default"] call FUNC(get);
_ctrlDefault ctrlEnable !(_currentValue isEqualTo _defaultValue);
_ctrlDefault ctrlEnable (_currentValue isNotEqualTo _defaultValue);

// automatically check "overwrite client" for mission makers qol
[_controlsGroup, _source] call (_controlsGroup getVariable QFUNC(auto_check_overwrite));
Expand Down Expand Up @@ -73,7 +73,7 @@ for "_index" from 0 to ((count _currentValue max 3 min 4) - 1) do {
// if new value is same as default value, grey out the default button
private _ctrlDefault = _controlsGroup controlsGroupCtrl IDC_SETTING_DEFAULT;
private _defaultValue = [_setting, "default"] call FUNC(get);
_ctrlDefault ctrlEnable !(_currentValue isEqualTo _defaultValue);
_ctrlDefault ctrlEnable (_currentValue isNotEqualTo _defaultValue);

// automatically check "overwrite client" for mission makers qol
[_controlsGroup, _source] call (_controlsGroup getVariable QFUNC(auto_check_overwrite));
Expand All @@ -98,7 +98,7 @@ for "_index" from 0 to ((count _currentValue max 3 min 4) - 1) do {
// if new value is same as default value, grey out the default button
private _ctrlDefault = _controlsGroup controlsGroupCtrl IDC_SETTING_DEFAULT;
private _defaultValue = [_setting, "default"] call FUNC(get);
_ctrlDefault ctrlEnable !(_currentValue isEqualTo _defaultValue);
_ctrlDefault ctrlEnable (_currentValue isNotEqualTo _defaultValue);
}];
};

Expand Down Expand Up @@ -127,5 +127,5 @@ _controlsGroup setVariable [QFUNC(updateUI), {

private _ctrlDefault = _controlsGroup controlsGroupCtrl IDC_SETTING_DEFAULT;
private _defaultValue = [_setting, "default"] call FUNC(get);
_ctrlDefault ctrlEnable !(_value isEqualTo _defaultValue);
_ctrlDefault ctrlEnable (_value isNotEqualTo _defaultValue);
}];
Loading

0 comments on commit 609d85e

Please sign in to comment.