From 41335d13a68b7851baa4168d1e3c19fc7bd0d814 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 9 Oct 2025 20:46:02 -0500 Subject: [PATCH] General - Optimize `isNil`/`getVariable` checks --- addons/arsenal/functions/fnc_attributeInit.sqf | 2 +- addons/arsenal/functions/fnc_initBox.sqf | 4 ++-- addons/arsenal/functions/fnc_onArsenalOpen.sqf | 4 ++-- addons/arsenal/functions/fnc_onSelChangedRight.sqf | 8 +------- addons/common/XEH_postInit.sqf | 2 +- addons/common/functions/fnc_readSettingFromModule.sqf | 2 +- addons/common/functions/fnc_setPlayerOwner.sqf | 2 +- addons/dogtags/XEH_postInit.sqf | 4 ++-- addons/dragging/functions/fnc_resumeCarry.sqf | 2 +- addons/fastroping/XEH_postInit.sqf | 2 +- addons/fire/functions/fnc_burnEffects.sqf | 2 +- addons/fire/functions/fnc_burnSimulation.sqf | 2 +- addons/fortify/functions/fnc_registerObjects.sqf | 4 ++-- addons/interact_menu/functions/fnc_compileMenuZeus.sqf | 2 +- addons/interact_menu/functions/fnc_initMenuReorder.sqf | 2 +- addons/medical_ai/stateMachine.inc.sqf | 8 ++++---- .../functions/fnc_enteredStateCardiacArrest.sqf | 2 +- .../functions/fnc_enteredStateDeath.sqf | 2 +- .../functions/fnc_enteredStateFatalInjury.sqf | 2 +- .../functions/fnc_enteredStateUnconscious.sqf | 2 +- addons/medical_treatment/XEH_postInit.sqf | 2 +- addons/rearm/functions/fnc_makeSource.sqf | 2 +- addons/refuel/functions/fnc_getCapacity.sqf | 2 +- addons/refuel/functions/fnc_makeSource.sqf | 4 ++-- addons/repair/functions/fnc_repair.sqf | 2 +- addons/respawn/functions/fnc_handleInitPostServer.sqf | 4 ++-- addons/safemode/functions/fnc_lockSafety.sqf | 2 +- addons/sitting/XEH_clientInit.sqf | 2 +- addons/sitting/functions/fnc_canSit.sqf | 2 +- addons/sitting/functions/fnc_canStand.sqf | 2 +- addons/sitting/functions/fnc_handleInterrupt.sqf | 2 +- addons/sitting/functions/fnc_sit.sqf | 2 +- addons/trenches/functions/fnc_removeTrench.sqf | 2 +- addons/vehicle_damage/functions/fnc_addEventHandler.sqf | 4 ++-- addons/weather/functions/fnc_getApproximateAirTemp.sqf | 2 +- 35 files changed, 45 insertions(+), 51 deletions(-) diff --git a/addons/arsenal/functions/fnc_attributeInit.sqf b/addons/arsenal/functions/fnc_attributeInit.sqf index 42e72056fce..42dbaf88619 100644 --- a/addons/arsenal/functions/fnc_attributeInit.sqf +++ b/addons/arsenal/functions/fnc_attributeInit.sqf @@ -26,7 +26,7 @@ if (_mode > 0) then { // Wait until all items have been added, so that the blacklisted items can be removed [{ - !isNil {(_this select 0) getVariable QGVAR(virtualItems)} + !((_this select 0) isNil QGVAR(virtualItems)) }, { [_this select 0, _this select 1, true] call FUNC(removeVirtualItems); }, [_object, _items], 20] call CBA_fnc_waitUntilAndExecute; // 20s timeout in case of failure diff --git a/addons/arsenal/functions/fnc_initBox.sqf b/addons/arsenal/functions/fnc_initBox.sqf index efdacab406e..02998f59a94 100644 --- a/addons/arsenal/functions/fnc_initBox.sqf +++ b/addons/arsenal/functions/fnc_initBox.sqf @@ -22,7 +22,7 @@ params [["_object", objNull, [objNull]], ["_items", true, [[], true]], ["_global if (isNull _object) exitWith {}; -if (_global && {isMultiplayer} && {isNil {_object getVariable QGVAR(initBoxJIP)}}) then { +if (_global && {isMultiplayer} && {(_object isNil QGVAR(initBoxJIP))}) then { private _id = [QGVAR(initBox), [_object, _items, false]] call CBA_fnc_globalEventJIP; // Remove JIP EH if object is deleted @@ -52,7 +52,7 @@ if (_global && {isMultiplayer} && {isNil {_object getVariable QGVAR(initBoxJIP)} [_object, 0, ["ACE_MainActions"], _action] call EFUNC(interact_menu,addActionToObject); // If items were set globally, do not add items locally - if (isNil {_object getVariable QGVAR(virtualItems)}) then { + if ((_object isNil QGVAR(virtualItems))) then { [_object, _items, false] call FUNC(addVirtualItems); }; diff --git a/addons/arsenal/functions/fnc_onArsenalOpen.sqf b/addons/arsenal/functions/fnc_onArsenalOpen.sqf index 2a2d8716c84..a9a4f3326af 100644 --- a/addons/arsenal/functions/fnc_onArsenalOpen.sqf +++ b/addons/arsenal/functions/fnc_onArsenalOpen.sqf @@ -30,7 +30,7 @@ if (isNil QGVAR(sharedLoadoutsNamespace)) then { publicVariable QGVAR(sharedLoadoutsNamespace); }; -if (isNil {GVAR(sharedLoadoutsNamespace) getVariable QGVAR(sharedLoadoutsVars)}) then { +if ((GVAR(sharedLoadoutsNamespace) isNil QGVAR(sharedLoadoutsVars))) then { GVAR(sharedLoadoutsNamespace) setVariable [QGVAR(sharedLoadoutsVars), [], true]; }; @@ -42,7 +42,7 @@ if (isNil QGVAR(defaultLoadoutsList)) then { }; }; -if (isNil {profileNamespace getVariable QGVAR(saved_loadouts)}) then { +if ((profileNamespace isNil QGVAR(saved_loadouts))) then { profileNamespace setVariable [QGVAR(saved_loadouts), []]; }; diff --git a/addons/arsenal/functions/fnc_onSelChangedRight.sqf b/addons/arsenal/functions/fnc_onSelChangedRight.sqf index 66315f7dc79..7271303a2a5 100644 --- a/addons/arsenal/functions/fnc_onSelChangedRight.sqf +++ b/addons/arsenal/functions/fnc_onSelChangedRight.sqf @@ -70,13 +70,7 @@ switch (_currentItemsIndex) do { case IDX_CURR_SECONDARY_WEAPON_ITEMS: { private _currentItemInSlot = (GVAR(currentItems) select IDX_CURR_SECONDARY_WEAPON_ITEMS) select _itemIndex; private _isDisposable = CBA_disposable_replaceDisposableLauncher && {!isNil "CBA_disposable_loadedLaunchers"} && - { - if (CBA_disposable_loadedLaunchers isEqualType createHashMap) then { // after CBA 3.18 - (secondaryWeapon GVAR(center)) in CBA_disposable_loadedLaunchers - } else { - !isNil {CBA_disposable_loadedLaunchers getVariable (secondaryWeapon player)} - } - }; + {(secondaryWeapon GVAR(center)) in CBA_disposable_loadedLaunchers}; // If removal if (_item == "") then { diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index c7babed894b..468981640e1 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -580,7 +580,7 @@ GVAR(isReloading) = false; call FUNC(swayLoop); }; // check for pre-3.16 sway factors being added - if (!isNil {missionNamespace getVariable "ACE_setCustomAimCoef"}) then { + if (!(missionNamespace isNil "ACE_setCustomAimCoef")) then { WARNING("ACE_setCustomAimCoef no longer supported - use ace_common_fnc_addSwayFactor"); WARNING_1("source: %1",(missionNamespace getVariable "ACE_setCustomAimCoef") apply {_x}); }; diff --git a/addons/common/functions/fnc_readSettingFromModule.sqf b/addons/common/functions/fnc_readSettingFromModule.sqf index f551f7dca57..b998e96093d 100644 --- a/addons/common/functions/fnc_readSettingFromModule.sqf +++ b/addons/common/functions/fnc_readSettingFromModule.sqf @@ -26,7 +26,7 @@ if (isNil _settingName) exitWith { }; // Check if the parameter is defined in the module -if (isNil {_logic getVariable _moduleVariable}) exitWith { +if ((_logic isNil _moduleVariable)) exitWith { WARNING_2("Warning in %1 module: %2 setting is missing. Probably an obsolete version of the module is used in the mission.",typeOf _logic,_moduleVariable); }; diff --git a/addons/common/functions/fnc_setPlayerOwner.sqf b/addons/common/functions/fnc_setPlayerOwner.sqf index 010f0b9b462..fca2ba6bcb8 100644 --- a/addons/common/functions/fnc_setPlayerOwner.sqf +++ b/addons/common/functions/fnc_setPlayerOwner.sqf @@ -24,7 +24,7 @@ if (isServer) then { addMissionEventHandler ["HandleDisconnect", { params ["_dcPlayer"]; TRACE_1("HandleDisconnect eh",_dcPlayer); - if (!isNil {_dcPlayer getVariable QGVAR(playerOwner)}) then { + if (!(_dcPlayer isNil QGVAR(playerOwner))) then { _dcPlayer setVariable [QGVAR(playerOwner), nil, true]; }; }]; diff --git a/addons/dogtags/XEH_postInit.sqf b/addons/dogtags/XEH_postInit.sqf index ca4992c034b..8fd58dc1310 100644 --- a/addons/dogtags/XEH_postInit.sqf +++ b/addons/dogtags/XEH_postInit.sqf @@ -94,7 +94,7 @@ if (hasInterface) then { format ["%1: %2", LLSTRING(itemName), LLSTRING(checkDogtag)], QPATHTOF(data\dogtag_icon_ca.paa), {[_player, _target] call FUNC(checkDogtag)}, - {!isNil {_target getVariable QGVAR(dogtagData)}} + {!(_target isNil QGVAR(dogtagData))} ] call EFUNC(interact_menu,createAction); ["ACE_bodyBagObject", 0, ["ACE_MainActions"], _checkTagAction, true] call EFUNC(interact_menu,addActionToClass); @@ -104,7 +104,7 @@ if (hasInterface) then { format ["%1: %2", LLSTRING(itemName), LLSTRING(takeDogtag)], QPATHTOF(data\dogtag_icon_ca.paa), {[_player, _target] call FUNC(takeDogtag)}, - {(!isNil {_target getVariable QGVAR(dogtagData)}) && {((_target getVariable [QGVAR(dogtagTaken), objNull]) != _target)}} + {(!(_target isNil QGVAR(dogtagData))) && {((_target getVariable [QGVAR(dogtagTaken), objNull]) != _target)}} ] call EFUNC(interact_menu,createAction); ["ACE_bodyBagObject", 0, ["ACE_MainActions"], _takeTagAction, true] call EFUNC(interact_menu,addActionToClass); diff --git a/addons/dragging/functions/fnc_resumeCarry.sqf b/addons/dragging/functions/fnc_resumeCarry.sqf index 3d50c871ac8..c3956c4ada9 100644 --- a/addons/dragging/functions/fnc_resumeCarry.sqf +++ b/addons/dragging/functions/fnc_resumeCarry.sqf @@ -21,7 +21,7 @@ params ["_unit"]; if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith {}; // If action is already present, don't add it again -if (!isNil {_unit getVariable QGVAR(releaseActionID)}) exitWith {}; +if (!(_unit isNil QGVAR(releaseActionID))) exitWith {}; // Remove drop action _unit setVariable [QGVAR(releaseActionID), [ diff --git a/addons/fastroping/XEH_postInit.sqf b/addons/fastroping/XEH_postInit.sqf index 2e6da10a2ab..c8652127b9f 100644 --- a/addons/fastroping/XEH_postInit.sqf +++ b/addons/fastroping/XEH_postInit.sqf @@ -34,7 +34,7 @@ if (isServer) then { ["Air", "init", { if (!GVAR(autoAddFRIES)) exitWith {}; params ["_vehicle"]; - if (isNumber (configOf _vehicle >> QGVAR(enabled)) && {isNil {_vehicle getVariable [QGVAR(FRIES), nil]}}) then { + if (isNumber (configOf _vehicle >> QGVAR(enabled)) && {(_vehicle isNil QGVAR(FRIES))}) then { [_vehicle] call FUNC(equipFRIES); }; }, true, ["ACE_friesBase"], true] call CBA_fnc_addClassEventHandler; diff --git a/addons/fire/functions/fnc_burnEffects.sqf b/addons/fire/functions/fnc_burnEffects.sqf index 4dadda8526c..d2ac3915cc2 100644 --- a/addons/fire/functions/fnc_burnEffects.sqf +++ b/addons/fire/functions/fnc_burnEffects.sqf @@ -76,7 +76,7 @@ if (isServer) then { }; // Display burn indicators - if (_unit == ACE_player && {alive _unit} && {isNil {_unit getVariable QGVAR(burnUIPFH)}}) then { // This accounts for player remote controlled a new unit + if (_unit == ACE_player && {alive _unit} && {(_unit isNil QGVAR(burnUIPFH))}) then { // This accounts for player remote controlled a new unit private _burnIndicatorPFH = [LINKFUNC(burnIndicator), 1, _unit] call CBA_fnc_addPerFrameHandler; _unit setVariable [QGVAR(burnUIPFH), _burnIndicatorPFH]; }; diff --git a/addons/fire/functions/fnc_burnSimulation.sqf b/addons/fire/functions/fnc_burnSimulation.sqf index e061d1ce915..5c4fb005646 100644 --- a/addons/fire/functions/fnc_burnSimulation.sqf +++ b/addons/fire/functions/fnc_burnSimulation.sqf @@ -54,7 +54,7 @@ params ["_unit", "_instigator"]; _pfhID call CBA_fnc_removePerFrameHandler; - if (!isNil {_unit getVariable QGVAR(stopDropRoll)} && {!isPlayer _unit}) then { + if (!(_unit isNil QGVAR(stopDropRoll)) && {!isPlayer _unit}) then { _unit setUnitPos "AUTO"; _unit setVariable [QGVAR(stopDropRoll), nil, true]; diff --git a/addons/fortify/functions/fnc_registerObjects.sqf b/addons/fortify/functions/fnc_registerObjects.sqf index b415b6df885..59aa0f6aa13 100644 --- a/addons/fortify/functions/fnc_registerObjects.sqf +++ b/addons/fortify/functions/fnc_registerObjects.sqf @@ -41,10 +41,10 @@ _objects = _objects select { _isValid }; -if (!isNil {missionNamespace getVariable format [QGVAR(Budget_%1), _side]}) then { +if (!(missionNamespace isNil format [QGVAR(Budget_%1), _side])) then { INFO_1("Overwriting previous budget for side [%1]",_side); }; -if (!isNil {missionNamespace getVariable format [QGVAR(Objects_%1), _side]}) then { +if (!(missionNamespace isNil format [QGVAR(Objects_%1), _side])) then { INFO_1("Overwriting previous objects for side [%1]",_side); }; diff --git a/addons/interact_menu/functions/fnc_compileMenuZeus.sqf b/addons/interact_menu/functions/fnc_compileMenuZeus.sqf index e4b926b3e3f..3f672714c9d 100644 --- a/addons/interact_menu/functions/fnc_compileMenuZeus.sqf +++ b/addons/interact_menu/functions/fnc_compileMenuZeus.sqf @@ -16,7 +16,7 @@ */ // Exit if the action menu is already compiled for zeus -if (!isNil {missionNamespace getVariable [QGVAR(ZeusActions), nil]}) exitWith {}; +if (!(missionNamespace isNil QGVAR(ZeusActions))) exitWith {}; private _recurseFnc = { params ["_actionsCfg"]; diff --git a/addons/interact_menu/functions/fnc_initMenuReorder.sqf b/addons/interact_menu/functions/fnc_initMenuReorder.sqf index d55f2f06ea6..04c60902a8a 100644 --- a/addons/interact_menu/functions/fnc_initMenuReorder.sqf +++ b/addons/interact_menu/functions/fnc_initMenuReorder.sqf @@ -36,7 +36,7 @@ private _fnc_processNode = { private _conditionFullString = format ["%1 && {%2}", _parentConditionString, _condition call EFUNC(common,codeToString)]; // don't add already added setting - if (isNil {missionNamespace getVariable _varName}) then { + if ((missionNamespace isNil _varName)) then { [_varName, "CHECKBOX", _titleFull, [_settingCategory, _rootActionTitle], false, 2, {}, true] call CBA_fnc_addSetting; }; diff --git a/addons/medical_ai/stateMachine.inc.sqf b/addons/medical_ai/stateMachine.inc.sqf index 73b82f98a9c..f2acb64c41f 100644 --- a/addons/medical_ai/stateMachine.inc.sqf +++ b/addons/medical_ai/stateMachine.inc.sqf @@ -31,7 +31,7 @@ GVAR(stateMachine) = [{call EFUNC(common,getLocalUnits)}, true] call CBA_statema [GVAR(stateMachine), "HealSelf", "Initial", { // Go back to initial state when done healing - !(call FUNC(isInjured)) && {isNil {_this getVariable QGVAR(currentTreatment)}} + !(call FUNC(isInjured)) && {(_this isNil QGVAR(currentTreatment))} }, { #ifdef DEBUG_MODE_FULL systemChat format ["%1 finished healing themself", _this]; @@ -39,7 +39,7 @@ GVAR(stateMachine) = [{call EFUNC(common,getLocalUnits)}, true] call CBA_statema }, "Initial"] call CBA_statemachine_fnc_addTransition; [GVAR(stateMachine), "HealSelf", "Injured", { // Stop treating when it's no more safe - !(call FUNC(isSafe)) && {isNil {_this getVariable QGVAR(currentTreatment)}} + !(call FUNC(isSafe)) && {(_this isNil QGVAR(currentTreatment))} }, { #ifdef DEBUG_MODE_FULL systemChat format ["%1 is no longer safe", _this]; @@ -48,7 +48,7 @@ GVAR(stateMachine) = [{call EFUNC(common,getLocalUnits)}, true] call CBA_statema [GVAR(stateMachine), "HealUnit", "Initial", { // Go back to initial state when done healing or it's no more safe to treat - !((call FUNC(wasRequested)) && FUNC(isSafe)) && {isNil {_this getVariable QGVAR(currentTreatment)}} + !((call FUNC(wasRequested)) && FUNC(isSafe)) && {(_this isNil QGVAR(currentTreatment))} }, { #ifdef DEBUG_MODE_FULL systemChat format ["%1 finished healing someone", _this]; @@ -56,7 +56,7 @@ GVAR(stateMachine) = [{call EFUNC(common,getLocalUnits)}, true] call CBA_statema }, "Initial"] call CBA_statemachine_fnc_addTransition; [GVAR(stateMachine), "HealUnit", "Injured", { // Treating yourself has priority - (call FUNC(isInjured)) && {isNil {_this getVariable QGVAR(currentTreatment)}} + (call FUNC(isInjured)) && {(_this isNil QGVAR(currentTreatment))} }, { #ifdef DEBUG_MODE_FULL systemChat format ["%1 was injured while healing someone", _this]; diff --git a/addons/medical_statemachine/functions/fnc_enteredStateCardiacArrest.sqf b/addons/medical_statemachine/functions/fnc_enteredStateCardiacArrest.sqf index 313baf6505c..f5be9c17fb6 100644 --- a/addons/medical_statemachine/functions/fnc_enteredStateCardiacArrest.sqf +++ b/addons/medical_statemachine/functions/fnc_enteredStateCardiacArrest.sqf @@ -17,7 +17,7 @@ */ params ["_unit"]; -if (isNull _unit || {!isNil {_unit getVariable QEGVAR(medical,causeOfDeath)}}) exitWith { +if (isNull _unit || {!(_unit isNil QEGVAR(medical,causeOfDeath))}) exitWith { WARNING_1("enteredStateCardiacArrest: State transition on dead or null unit - %1",_unit); }; diff --git a/addons/medical_statemachine/functions/fnc_enteredStateDeath.sqf b/addons/medical_statemachine/functions/fnc_enteredStateDeath.sqf index 8be1d358df4..ff7fa165a35 100644 --- a/addons/medical_statemachine/functions/fnc_enteredStateDeath.sqf +++ b/addons/medical_statemachine/functions/fnc_enteredStateDeath.sqf @@ -16,7 +16,7 @@ */ params ["_unit"]; -if (isNull _unit || {!isNil {_unit getVariable QEGVAR(medical,causeOfDeath)}}) exitWith { +if (isNull _unit || {!(_unit isNil QEGVAR(medical,causeOfDeath))}) exitWith { if ((_unit getVariable [QEGVAR(medical,causeOfDeath), ""]) == "#scripted") exitWith {}; WARNING_1("enteredStateDeath: State transition on dead or null unit - %1",_unit); }; diff --git a/addons/medical_statemachine/functions/fnc_enteredStateFatalInjury.sqf b/addons/medical_statemachine/functions/fnc_enteredStateFatalInjury.sqf index d5d81889dd6..c1d79e80d34 100644 --- a/addons/medical_statemachine/functions/fnc_enteredStateFatalInjury.sqf +++ b/addons/medical_statemachine/functions/fnc_enteredStateFatalInjury.sqf @@ -16,7 +16,7 @@ */ params ["_unit"]; -if (isNull _unit || {!isNil {_unit getVariable QEGVAR(medical,causeOfDeath)}}) exitWith { +if (isNull _unit || {!(_unit isNil QEGVAR(medical,causeOfDeath))}) exitWith { WARNING_1("enteredStateFatalInjury: State transition on dead or null unit - %1",_unit); }; diff --git a/addons/medical_statemachine/functions/fnc_enteredStateUnconscious.sqf b/addons/medical_statemachine/functions/fnc_enteredStateUnconscious.sqf index c80481bad23..2d2556dcb06 100644 --- a/addons/medical_statemachine/functions/fnc_enteredStateUnconscious.sqf +++ b/addons/medical_statemachine/functions/fnc_enteredStateUnconscious.sqf @@ -16,7 +16,7 @@ */ params ["_unit"]; -if (isNull _unit || {!isNil {_unit getVariable QEGVAR(medical,causeOfDeath)}}) exitWith { +if (isNull _unit || {!(_unit isNil QEGVAR(medical,causeOfDeath))}) exitWith { WARNING_1("enteredStateUnconscious: State transition on dead or null unit - %1",_unit); }; diff --git a/addons/medical_treatment/XEH_postInit.sqf b/addons/medical_treatment/XEH_postInit.sqf index 367b248fcaf..b00b52790c3 100644 --- a/addons/medical_treatment/XEH_postInit.sqf +++ b/addons/medical_treatment/XEH_postInit.sqf @@ -83,7 +83,7 @@ if (["ace_trenches"] call EFUNC(common,isModLoaded)) then { true ] call CBA_fnc_notify; }, - {!isNil {_target getVariable QGVAR(headstoneData)}} + {!(_target isNil QGVAR(headstoneData))} ] call EFUNC(interact_menu,createAction); [missionNamespace getVariable [QGVAR(graveClassname), "ACE_Grave"], 0, [], _checkHeadstoneAction] call EFUNC(interact_menu,addActionToClass); diff --git a/addons/rearm/functions/fnc_makeSource.sqf b/addons/rearm/functions/fnc_makeSource.sqf index 85acbfa43a0..c296fb839c9 100644 --- a/addons/rearm/functions/fnc_makeSource.sqf +++ b/addons/rearm/functions/fnc_makeSource.sqf @@ -52,7 +52,7 @@ if (!(_rearmCargoConfig > 0 && _source getVariable [QGVAR(isSupplyVehicle), fals _source setVariable [QGVAR(isSupplyVehicle), true, true]; // only add if menu does not already exist - if (isNil {_source getVariable QGVAR(initSupplyVehicle_jipID)}) then { + if ((_source isNil QGVAR(initSupplyVehicle_jipID))) then { private _jipID = [QGVAR(initSupplyVehicle), [_source]] call CBA_fnc_globalEventJIP; [_jipID, _source] call CBA_fnc_removeGlobalEventJIP; _source setVariable [QGVAR(initSupplyVehicle_jipID), _jipID]; diff --git a/addons/refuel/functions/fnc_getCapacity.sqf b/addons/refuel/functions/fnc_getCapacity.sqf index 3a42899174b..9d4776db200 100644 --- a/addons/refuel/functions/fnc_getCapacity.sqf +++ b/addons/refuel/functions/fnc_getCapacity.sqf @@ -30,7 +30,7 @@ if (isNil "_capacity") then { // Set capacity even if this isn't a fuel source to save on config lookup time in the event this function is used in a loop _source setVariable [QGVAR(capacity), _capacity, true]; // handle weird edge case when trying to run on "camera"/CfgNonAIVehicles which won't support setVariable and will inf-loop - if (isNil {_source getVariable QGVAR(capacity)}) exitWith { WARNING_1("trying to getCapacity from non-CfgVehicle %1",_this); }; + if ((_source isNil QGVAR(capacity))) exitWith { WARNING_1("trying to getCapacity from non-CfgVehicle %1",_this); }; [_source, _capacity] call FUNC(setFuel); }; diff --git a/addons/refuel/functions/fnc_makeSource.sqf b/addons/refuel/functions/fnc_makeSource.sqf index 9d76635849f..5b4c6d5c9f2 100644 --- a/addons/refuel/functions/fnc_makeSource.sqf +++ b/addons/refuel/functions/fnc_makeSource.sqf @@ -44,7 +44,7 @@ if ( // We might be removing fuel from an object that in config doesn't have fuel, but was given fuel via this function prior if (_fuelCargo == REFUEL_DISABLED_FUEL && {_fuelCargoConfig == REFUEL_DISABLED_FUEL}) exitWith { - if (isNil {_source getVariable QGVAR(currentFuelCargo)}) exitWith {}; + if ((_source isNil QGVAR(currentFuelCargo))) exitWith {}; _source setVariable [QGVAR(currentFuelCargo), nil, true]; _source setVariable [QGVAR(capacity), REFUEL_DISABLED_FUEL, true]; @@ -75,7 +75,7 @@ if ( }; // only add if menu doesn't already exist -if (_fuelCargoConfig != REFUEL_DISABLED_FUEL || {!isNil {_source getVariable QGVAR(initSource_jipID)}}) exitWith {}; +if (_fuelCargoConfig != REFUEL_DISABLED_FUEL || {!(_source isNil QGVAR(initSource_jipID))}) exitWith {}; private _jipID = [QGVAR(initSource), [_source]] call CBA_fnc_globalEventJIP; [_jipID, _source] call CBA_fnc_removeGlobalEventJIP; diff --git a/addons/repair/functions/fnc_repair.sqf b/addons/repair/functions/fnc_repair.sqf index 90331e75215..573ff3c35fe 100644 --- a/addons/repair/functions/fnc_repair.sqf +++ b/addons/repair/functions/fnc_repair.sqf @@ -188,7 +188,7 @@ if (_loopAnim) then { if (_anim isEqualTo (_caller getVariable [QGVAR(repairCurrentAnimCaller), ""])) then { [{ params ["_caller", "_anim"]; - if !(isNil {_caller getVariable QGVAR(repairCurrentAnimCaller)}) then { + if !((_caller isNil QGVAR(repairCurrentAnimCaller))) then { TRACE_2("loop",_caller,_anim); call EFUNC(common,doAnimation) }; diff --git a/addons/respawn/functions/fnc_handleInitPostServer.sqf b/addons/respawn/functions/fnc_handleInitPostServer.sqf index 8ac8bd76b62..22e719a3d30 100644 --- a/addons/respawn/functions/fnc_handleInitPostServer.sqf +++ b/addons/respawn/functions/fnc_handleInitPostServer.sqf @@ -37,7 +37,7 @@ private _leaderVarName = _groupUnit getVariable [QGVAR(leaderVarName), ""]; if (_leaderVarName != "") exitWith { // assign JIP unit as rallypoint leader if (str _unit == _leaderVarName) then { - if (isNil {_unit getVariable "ACE_canMoveRallypoint"}) then { + if ((_unit isNil "ACE_canMoveRallypoint")) then { _unit setVariable ["ACE_canMoveRallypoint", true, true]; }; }; @@ -61,6 +61,6 @@ if (_leaderVarName == "") then { // prevent group from getting multiple leaders; use this to assign rallypoint moving ability on JIP _groupUnit setVariable [QGVAR(leaderVarName), _leaderVarName]; -if (isNil {_unit getVariable "ACE_canMoveRallypoint"}) then { +if ((_unit isNil "ACE_canMoveRallypoint")) then { _unit setVariable ["ACE_canMoveRallypoint", true, true]; }; diff --git a/addons/safemode/functions/fnc_lockSafety.sqf b/addons/safemode/functions/fnc_lockSafety.sqf index b747ad52d25..adf48388c33 100644 --- a/addons/safemode/functions/fnc_lockSafety.sqf +++ b/addons/safemode/functions/fnc_lockSafety.sqf @@ -50,7 +50,7 @@ if (_weaponSelected) then { _safedWeaponMuzzles set [_muzzle, _firemode]; // Lock muzzle -if (isNil {_unit getVariable QGVAR(actionID)}) then { +if ((_unit isNil QGVAR(actionID))) then { _unit setVariable [QGVAR(actionID), [ _unit, "DefaultAction", { params ["", "_unit"]; diff --git a/addons/sitting/XEH_clientInit.sqf b/addons/sitting/XEH_clientInit.sqf index 4b3ea3fbadf..3a9275245c0 100644 --- a/addons/sitting/XEH_clientInit.sqf +++ b/addons/sitting/XEH_clientInit.sqf @@ -15,7 +15,7 @@ if (!hasInterface) exitWith {}; } forEach keys (uiNamespace getVariable [QGVAR(seats), []]); // Add interaction menu exception - ["isNotSitting", {isNil {(_this select 0) getVariable QGVAR(sittingStatus)}}] call EFUNC(common,addCanInteractWithCondition); + ["isNotSitting", {((_this select 0) isNil QGVAR(sittingStatus))}] call EFUNC(common,addCanInteractWithCondition); // Handle interruptions ["ace_unconscious", LINKFUNC(handleInterrupt)] call CBA_fnc_addEventHandler; diff --git a/addons/sitting/functions/fnc_canSit.sqf b/addons/sitting/functions/fnc_canSit.sqf index 5c8ea3be549..5ed0b3e8cb1 100644 --- a/addons/sitting/functions/fnc_canSit.sqf +++ b/addons/sitting/functions/fnc_canSit.sqf @@ -21,7 +21,7 @@ params ["_seat", "_player", ["_seatPos", 0]]; // Sitting enabled, not occupied and standing up (or not on a big slope) XGVAR(enable) && -{isNil {_player getVariable QGVAR(sittingStatus)}} && +{(_player isNil QGVAR(sittingStatus))} && {round (vectorUp _seat select 0) == 0 && {round (vectorUp _seat select 1) == 0} && {round (vectorUp _seat select 2) == 1}} && { private _seatsClaimed = _seat getVariable [QGVAR(seatsClaimed), []]; diff --git a/addons/sitting/functions/fnc_canStand.sqf b/addons/sitting/functions/fnc_canStand.sqf index fafe4f2cd88..c8a0c4931b6 100644 --- a/addons/sitting/functions/fnc_canStand.sqf +++ b/addons/sitting/functions/fnc_canStand.sqf @@ -18,4 +18,4 @@ params ["_player"]; // Sitting -!isNil {_player getVariable QGVAR(sittingStatus)} +!(_player isNil QGVAR(sittingStatus)) diff --git a/addons/sitting/functions/fnc_handleInterrupt.sqf b/addons/sitting/functions/fnc_handleInterrupt.sqf index ce1ec9fb6a2..1205fbff4ef 100644 --- a/addons/sitting/functions/fnc_handleInterrupt.sqf +++ b/addons/sitting/functions/fnc_handleInterrupt.sqf @@ -17,6 +17,6 @@ params ["_player"]; -if (!isNil {_player getVariable QGVAR(sittingStatus)}) then { +if (!(_player isNil QGVAR(sittingStatus))) then { _player call FUNC(stand); }; diff --git a/addons/sitting/functions/fnc_sit.sqf b/addons/sitting/functions/fnc_sit.sqf index e4d9d367c99..cf8af031189 100644 --- a/addons/sitting/functions/fnc_sit.sqf +++ b/addons/sitting/functions/fnc_sit.sqf @@ -83,7 +83,7 @@ private _seatDistOrig = (getPosASL _player) distance _seat; _args params ["_player", "_seat", "_seatPos", "_seatPosOrig", "_seatDistOrig"]; // Remove PFH if not sitting any more - if (isNil {_player getVariable QGVAR(sittingStatus)}) exitWith { + if ((_player isNil QGVAR(sittingStatus))) exitWith { [_pfhId] call CBA_fnc_removePerFrameHandler; TRACE_1("Remove PFH",_player getVariable [ARR_2(QGVAR(sittingStatus),false)]); diff --git a/addons/trenches/functions/fnc_removeTrench.sqf b/addons/trenches/functions/fnc_removeTrench.sqf index 0e9870eb8b5..7f6a62f1c33 100644 --- a/addons/trenches/functions/fnc_removeTrench.sqf +++ b/addons/trenches/functions/fnc_removeTrench.sqf @@ -28,7 +28,7 @@ _trench setVariable [QGVAR(digging), true, true]; private _removeTime = missionNamespace getVariable [getText (configOf _trench >> QGVAR(removalDuration)), 12]; private _removeTimeLeft = _removeTime * _actualProgress; -if (isNil {_trench getVariable QGVAR(placeData)}) then { +if ((_trench isNil QGVAR(placeData))) then { _trench setVariable [QGVAR(placeData), [getPosASL _trench, [vectorDir _trench, vectorUp _trench]], true]; }; private _placeData = _trench getVariable [QGVAR(placeData), [[], []]]; diff --git a/addons/vehicle_damage/functions/fnc_addEventHandler.sqf b/addons/vehicle_damage/functions/fnc_addEventHandler.sqf index 44ad4087993..cb2373a903a 100644 --- a/addons/vehicle_damage/functions/fnc_addEventHandler.sqf +++ b/addons/vehicle_damage/functions/fnc_addEventHandler.sqf @@ -24,7 +24,7 @@ if (!GVAR(enabled)) exitWith { #endif }; -if (!isNil {_vehicle getVariable QGVAR(handleDamage)}) exitWith {}; +if (!(_vehicle isNil QGVAR(handleDamage))) exitWith {}; _vehicle allowCrewInImmobile true; @@ -33,7 +33,7 @@ _vehicle allowCrewInImmobile true; [{ params ["_vehicle"]; - if (!isNil {_vehicle getVariable QGVAR(handleDamage)}) exitWith {}; + if (!(_vehicle isNil QGVAR(handleDamage))) exitWith {}; TRACE_1("added eh",_vehicle); diff --git a/addons/weather/functions/fnc_getApproximateAirTemp.sqf b/addons/weather/functions/fnc_getApproximateAirTemp.sqf index 91b8af3fccd..f73a2e387aa 100644 --- a/addons/weather/functions/fnc_getApproximateAirTemp.sqf +++ b/addons/weather/functions/fnc_getApproximateAirTemp.sqf @@ -18,7 +18,7 @@ params ["_unit"]; TRACE_1("params",_unit); -if (isNil {_unit getVariable "ACE_airTemperatureBias"}) then { +if ((_unit isNil "ACE_airTemperatureBias")) then { _unit setVariable ["ACE_airTemperatureBias", [-(random(3) + 1), random(3) + 1]]; };