From 03ade056112a8194615cdb5bf771f9b1515d224f Mon Sep 17 00:00:00 2001 From: Dystopian Date: Sat, 30 Dec 2017 16:38:45 +0300 Subject: [PATCH] Add parentheses to GETVAR macros --- addons/captives/XEH_postInit.sqf | 6 +++--- addons/captives/functions/fnc_doEscortCaptive.sqf | 2 +- addons/common/functions/fnc_errorMessage.sqf | 2 +- .../common/functions/fnc_isFeatureCameraActive.sqf | 14 +++++++------- addons/goggles/XEH_postInit.sqf | 2 +- addons/goggles/script_component.hpp | 2 +- addons/main/script_macros.hpp | 12 ++++++------ addons/parachute/functions/fnc_handleReserve.sqf | 2 +- .../functions/fnc_handleInteractMenuOpened.sqf | 2 +- .../tacticalladder/functions/fnc_handleKilled.sqf | 2 +- .../functions/fnc_handlePlayerChanged.sqf | 2 +- .../functions/fnc_handleUnconscious.sqf | 2 +- 12 files changed, 25 insertions(+), 25 deletions(-) diff --git a/addons/captives/XEH_postInit.sqf b/addons/captives/XEH_postInit.sqf index 196cacbbe7..70d708ced2 100644 --- a/addons/captives/XEH_postInit.sqf +++ b/addons/captives/XEH_postInit.sqf @@ -52,6 +52,6 @@ if (!hasInterface) exitWith {}; {false}, [DIK_F1, [true, false, false]], true] call CBA_fnc_addKeybind; // Shift + F1 -["isNotEscorting", {!(GETVAR(_this select 0,GVAR(isEscorting),false))}] call EFUNC(common,addCanInteractWithCondition); -["isNotHandcuffed", {!(GETVAR(_this select 0,GVAR(isHandcuffed),false))}] call EFUNC(common,addCanInteractWithCondition); -["isNotSurrendering", {!(GETVAR(_this select 0,GVAR(isSurrendering),false))}] call EFUNC(common,addCanInteractWithCondition); +["isNotEscorting", {!GETVAR(_this select 0,GVAR(isEscorting),false)}] call EFUNC(common,addCanInteractWithCondition); +["isNotHandcuffed", {!GETVAR(_this select 0,GVAR(isHandcuffed),false)}] call EFUNC(common,addCanInteractWithCondition); +["isNotSurrendering", {!GETVAR(_this select 0,GVAR(isSurrendering),false)}] call EFUNC(common,addCanInteractWithCondition); diff --git a/addons/captives/functions/fnc_doEscortCaptive.sqf b/addons/captives/functions/fnc_doEscortCaptive.sqf index ad57dabcd7..b17a48f7b8 100644 --- a/addons/captives/functions/fnc_doEscortCaptive.sqf +++ b/addons/captives/functions/fnc_doEscortCaptive.sqf @@ -32,7 +32,7 @@ if (_state) then { //Add Actionmenu to release captive private _actionID = _unit addAction [format ["%1", localize LSTRING(StopEscorting)], {[(_this select 0), ((_this select 0) getVariable [QGVAR(escortedUnit), objNull]), false] call FUNC(doEscortCaptive);}, - nil, 20, false, true, "", QUOTE(!isNull (GETVAR(_target,QGVAR(escortedUnit),objNull)))]; + nil, 20, false, true, "", QUOTE(!isNull GETVAR(_target,QGVAR(escortedUnit),objNull))]; [{ params ["_args", "_pfID"]; diff --git a/addons/common/functions/fnc_errorMessage.sqf b/addons/common/functions/fnc_errorMessage.sqf index 8ccd7c22fb..1be21e0e58 100644 --- a/addons/common/functions/fnc_errorMessage.sqf +++ b/addons/common/functions/fnc_errorMessage.sqf @@ -38,7 +38,7 @@ if (_textMessage isEqualType "") then { _textMessage = parseText _textMessage; }; -(ARR_SELECT(_this,4,call BIS_fnc_displayMission)) createDisplay "RscDisplayCommonMessagePause"; +ARR_SELECT(_this,4,call BIS_fnc_displayMission) createDisplay "RscDisplayCommonMessagePause"; private _display = uiNamespace getVariable "RscDisplayCommonMessage_display"; private _ctrlRscMessageBox = _display displayCtrl 2351; diff --git a/addons/common/functions/fnc_isFeatureCameraActive.sqf b/addons/common/functions/fnc_isFeatureCameraActive.sqf index 2f3cafe35d..dfe3869905 100644 --- a/addons/common/functions/fnc_isFeatureCameraActive.sqf +++ b/addons/common/functions/fnc_isFeatureCameraActive.sqf @@ -26,11 +26,11 @@ !( isNull curatorCamera && // Curator - {!(GETMVAR(EGVAR(spectator,isSet),false))} && // ACE Spectator - {isNull (GETMVAR(BIS_EGSpectatorCamera_camera, objNull))} && // BIS Nexus Spectator - {isNull (GETUVAR(BIS_fnc_arsenal_cam, objNull))} && // Arsenal camera - {isNull (GETMVAR(BIS_fnc_establishingShot_fakeUAV, objNull))} && // Establishing shot camera - {isNull (GETMVAR(BIS_fnc_camera_cam, objNull))} && // Splendid camera - {isNull (GETUVAR(BIS_fnc_animViewer_cam, objNull))} && // Animation viewer camera - {isNull (GETMVAR(BIS_DEBUG_CAM, objNull))} // Classic camera + {!GETMVAR(EGVAR(spectator,isSet),false)} && // ACE Spectator + {isNull GETMVAR(BIS_EGSpectatorCamera_camera, objNull)} && // BIS Nexus Spectator + {isNull GETUVAR(BIS_fnc_arsenal_cam, objNull)} && // Arsenal camera + {isNull GETMVAR(BIS_fnc_establishingShot_fakeUAV, objNull)} && // Establishing shot camera + {isNull GETMVAR(BIS_fnc_camera_cam, objNull)} && // Splendid camera + {isNull GETUVAR(BIS_fnc_animViewer_cam, objNull)} && // Animation viewer camera + {isNull GETMVAR(BIS_DEBUG_CAM, objNull)} // Classic camera ) // return diff --git a/addons/goggles/XEH_postInit.sqf b/addons/goggles/XEH_postInit.sqf index 5b93a7a459..9927a165f1 100644 --- a/addons/goggles/XEH_postInit.sqf +++ b/addons/goggles/XEH_postInit.sqf @@ -4,7 +4,7 @@ if (!hasInterface) exitWith {}; ["ACE3 Common", QGVAR(wipeGlasses), localize LSTRING(WipeGlasses), { if (GVAR(effects) != 2) exitWith {false}; //Can only wipe if full effects setting is set - if (!(GETVAR(ace_player,ACE_isUnconscious,false))) exitWith { + if (!GETVAR(ace_player,ACE_isUnconscious,false)) exitWith { call FUNC(clearGlasses); true }; diff --git a/addons/goggles/script_component.hpp b/addons/goggles/script_component.hpp index c0c8e43df4..854e27fab3 100644 --- a/addons/goggles/script_component.hpp +++ b/addons/goggles/script_component.hpp @@ -37,6 +37,6 @@ #define DBULLETS 2 #define DAMOUNT 3 -#define GLASSDISPLAY (GETUVAR(GVAR(Display),displayNull)) +#define GLASSDISPLAY GETUVAR(GVAR(Display),displayNull) #define CLAMP(x,low,high) (if(x > high)then{high}else{if(x < low)then{low}else{x}}) diff --git a/addons/main/script_macros.hpp b/addons/main/script_macros.hpp index 5480797513..16a33583a0 100644 --- a/addons/main/script_macros.hpp +++ b/addons/main/script_macros.hpp @@ -20,11 +20,11 @@ #define SETPVAR_SYS(var1,var2) setVariable [ARR_3(QUOTE(var1),var2,true)] #undef GETVAR -#define GETVAR(var1,var2,var3) var1 GETVAR_SYS(var2,var3) -#define GETMVAR(var1,var2) missionNamespace GETVAR_SYS(var1,var2) -#define GETUVAR(var1,var2) uiNamespace GETVAR_SYS(var1,var2) -#define GETPRVAR(var1,var2) profileNamespace GETVAR_SYS(var1,var2) -#define GETPAVAR(var1,var2) parsingNamespace GETVAR_SYS(var1,var2) +#define GETVAR(var1,var2,var3) (var1 GETVAR_SYS(var2,var3)) +#define GETMVAR(var1,var2) (missionNamespace GETVAR_SYS(var1,var2)) +#define GETUVAR(var1,var2) (uiNamespace GETVAR_SYS(var1,var2)) +#define GETPRVAR(var1,var2) (profileNamespace GETVAR_SYS(var1,var2)) +#define GETPAVAR(var1,var2) (parsingNamespace GETVAR_SYS(var1,var2)) #undef SETVAR #define SETVAR(var1,var2,var3) var1 SETVAR_SYS(var2,var3) @@ -37,7 +37,7 @@ #define GETGVAR(var1,var2) GETMVAR(GVAR(var1),var2) #define GETEGVAR(var1,var2,var3) GETMVAR(EGVAR(var1,var2),var3) -#define ARR_SELECT(ARRAY,INDEX,DEFAULT) if (count ARRAY > INDEX) then {ARRAY select INDEX} else {DEFAULT} +#define ARR_SELECT(ARRAY,INDEX,DEFAULT) (if (count ARRAY > INDEX) then {ARRAY select INDEX} else {DEFAULT}) #define MACRO_ADDWEAPON(WEAPON,COUNT) class _xx_##WEAPON { \ diff --git a/addons/parachute/functions/fnc_handleReserve.sqf b/addons/parachute/functions/fnc_handleReserve.sqf index 7a42d25ed9..7b92d8e9f4 100644 --- a/addons/parachute/functions/fnc_handleReserve.sqf +++ b/addons/parachute/functions/fnc_handleReserve.sqf @@ -25,7 +25,7 @@ if ( {GETVAR(_unit,GVAR(hasReserve),false)} ) then { // Case where unit has just opened parachute and reserve should be added - _unit addBackpackGlobal (GETVAR(_unit,GVAR(backpackClass),"ACE_NonSteerableReserveParachute")); + _unit addBackpackGlobal GETVAR(_unit,GVAR(backpackClass),"ACE_NonSteerableReserveParachute"); SETVAR(vehicle _unit,GVAR(canCut),true); // Mark the parachute cuttable since reserve is present } else { // Case where inventory has changed otherwise (including when reserve is added) diff --git a/addons/tacticalladder/functions/fnc_handleInteractMenuOpened.sqf b/addons/tacticalladder/functions/fnc_handleInteractMenuOpened.sqf index 4c46ea46c2..1e023b22b0 100644 --- a/addons/tacticalladder/functions/fnc_handleInteractMenuOpened.sqf +++ b/addons/tacticalladder/functions/fnc_handleInteractMenuOpened.sqf @@ -17,6 +17,6 @@ params ["_unit"]; -if (!isNull (GETMVAR(GVAR(ladder),objNull)) && {GVAR(ladder) in attachedObjects _unit}) then { +if (!isNull GETMVAR(GVAR(ladder),objNull) && {GVAR(ladder) in attachedObjects _unit}) then { [_unit, GVAR(ladder)] call FUNC(cancelTLdeploy); }; diff --git a/addons/tacticalladder/functions/fnc_handleKilled.sqf b/addons/tacticalladder/functions/fnc_handleKilled.sqf index 742231900c..0983901010 100644 --- a/addons/tacticalladder/functions/fnc_handleKilled.sqf +++ b/addons/tacticalladder/functions/fnc_handleKilled.sqf @@ -17,6 +17,6 @@ params ["_unit"]; -if (!isNull (GETMVAR(ladder,objNull)) && {GVAR(ladder) in attachedObjects _unit}) then { +if (!isNull GETMVAR(ladder,objNull) && {GVAR(ladder) in attachedObjects _unit}) then { [_unit, GVAR(ladder)] call FUNC(cancelTLdeploy); }; diff --git a/addons/tacticalladder/functions/fnc_handlePlayerChanged.sqf b/addons/tacticalladder/functions/fnc_handlePlayerChanged.sqf index 713c75df7f..f2bac289d1 100644 --- a/addons/tacticalladder/functions/fnc_handlePlayerChanged.sqf +++ b/addons/tacticalladder/functions/fnc_handlePlayerChanged.sqf @@ -16,7 +16,7 @@ */ #include "script_component.hpp" -if (isNull (GETGVAR(ladder,objNull))) exitWith {}; +if (isNull GETGVAR(ladder,objNull)) exitWith {}; params ["_newPlayer", "_oldPlayer"]; diff --git a/addons/tacticalladder/functions/fnc_handleUnconscious.sqf b/addons/tacticalladder/functions/fnc_handleUnconscious.sqf index 287e465e30..9d6f8ad23e 100644 --- a/addons/tacticalladder/functions/fnc_handleUnconscious.sqf +++ b/addons/tacticalladder/functions/fnc_handleUnconscious.sqf @@ -19,6 +19,6 @@ params ["_unit"]; if (!local _unit) exitWith {}; -if (!isNull (GETMVAR(ladder,objNull)) && {GVAR(ladder) in attachedObjects _unit}) then { +if (!isNull GETMVAR(ladder,objNull) && {GVAR(ladder) in attachedObjects _unit}) then { [_unit, GVAR(ladder)] call FUNC(cancelTLdeploy); };