diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index f96028c352..168fe8f9b3 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -16,7 +16,6 @@ PREP(blurScreen); PREP(cachedCall); PREP(canGetInPosition); PREP(canInteractWith); -PREP(canUseWeapon); PREP(changeProjectileDirection); PREP(checkFiles); PREP(checkPBOs); @@ -293,6 +292,9 @@ PREP(hashListSelect); PREP(hashListSet); PREP(hashListPush); +// backwards comp +DFUNC(canUseWeapon) = CBA_fnc_canUseWeapon; + GVAR(syncedEvents) = HASH_CREATE; GVAR(showHudHash) = [] call FUNC(hashCreate); diff --git a/addons/grenades/XEH_postInit.sqf b/addons/grenades/XEH_postInit.sqf index 38945ccc11..d4cc01f06f 100644 --- a/addons/grenades/XEH_postInit.sqf +++ b/addons/grenades/XEH_postInit.sqf @@ -15,7 +15,7 @@ GVAR(flashbangPPEffectCC) ppEffectForceInNVG true; // Conditions: canInteract if !([ACE_player, objNull, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if (!([ACE_player] call EFUNC(common,canUseWeapon))) exitWith {false}; + if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; // Statement [] call FUNC(nextMode); diff --git a/addons/laserpointer/initKeybinds.sqf b/addons/laserpointer/initKeybinds.sqf index a4164d420e..2251ddfb71 100644 --- a/addons/laserpointer/initKeybinds.sqf +++ b/addons/laserpointer/initKeybinds.sqf @@ -5,7 +5,7 @@ // Conditions: canInteract if !([ACE_player, objNull, ["isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; + if !([ACE_player] call CBA_fnc_canUseWeapon) exitWith {false}; [ACE_player, currentWeapon ACE_player] call FUNC(switchLaserLightMode); true diff --git a/addons/overheating/XEH_postInit.sqf b/addons/overheating/XEH_postInit.sqf index 38c0298b0f..ace0318c20 100644 --- a/addons/overheating/XEH_postInit.sqf +++ b/addons/overheating/XEH_postInit.sqf @@ -22,7 +22,7 @@ GVAR(cacheWeaponData) setText QGVAR(cacheWeaponData); // Conditions: canInteract if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if !([ACE_player] call EFUNC(common,canUseWeapon) && + if !([ACE_player] call CBA_fnc_canUseWeapon && {currentWeapon ACE_player in (ACE_player getVariable [QGVAR(jammedWeapons), []])} ) exitWith {false}; diff --git a/addons/overheating/functions/fnc_jamWeapon.sqf b/addons/overheating/functions/fnc_jamWeapon.sqf index 1580ac240e..38184808d2 100644 --- a/addons/overheating/functions/fnc_jamWeapon.sqf +++ b/addons/overheating/functions/fnc_jamWeapon.sqf @@ -46,7 +46,7 @@ GVAR(knowAboutJam) = false; if (_unit getVariable [QGVAR(JammingActionID), -1] == -1) then { private _condition = { - [_this select 1] call EFUNC(common,canUseWeapon) + [_this select 1] call CBA_fnc_canUseWeapon && {currentMuzzle (_this select 1) in ((_this select 1) getVariable [QGVAR(jammedWeapons), []])} && {!(currentMuzzle (_this select 1) in ((_this select 1) getVariable [QEGVAR(safemode,safedWeapons), []]))} }; diff --git a/addons/reload/XEH_postInit.sqf b/addons/reload/XEH_postInit.sqf index 8667d9815e..81b09e102c 100644 --- a/addons/reload/XEH_postInit.sqf +++ b/addons/reload/XEH_postInit.sqf @@ -1,4 +1,4 @@ -// by esteldunedain +s// by esteldunedain #include "script_component.hpp" if (!hasInterface) exitWith {}; @@ -9,7 +9,7 @@ if (!hasInterface) exitWith {}; // Conditions: canInteract if !([ACE_player, vehicle ACE_player, ["isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if !(ACE_player call EFUNC(common,canUseWeapon) || {(vehicle ACE_player) isKindOf "StaticWeapon"}) exitWith {false}; + if !(ACE_player call CBA_fnc_canUseWeapon || {(vehicle ACE_player) isKindOf "StaticWeapon"}) exitWith {false}; // Statement [ACE_player] call FUNC(checkAmmo); diff --git a/addons/safemode/XEH_postInit.sqf b/addons/safemode/XEH_postInit.sqf index f3ab06d20e..d9be666426 100644 --- a/addons/safemode/XEH_postInit.sqf +++ b/addons/safemode/XEH_postInit.sqf @@ -13,7 +13,7 @@ if (!hasInterface) exitWith {}; // Conditions: canInteract if !([ACE_player, objNull, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if !([ACE_player] call EFUNC(common,canUseWeapon) && {currentWeapon ACE_player != binocular ACE_player}) exitWith {false}; + if !([ACE_player] call CBA_fnc_canUseWeapon && {currentWeapon ACE_player != binocular ACE_player}) exitWith {false}; // Statement [ACE_player, currentWeapon ACE_player, currentMuzzle ACE_player] call FUNC(lockSafety); diff --git a/addons/safemode/functions/fnc_lockSafety.sqf b/addons/safemode/functions/fnc_lockSafety.sqf index 4d4b89759a..2675068e94 100644 --- a/addons/safemode/functions/fnc_lockSafety.sqf +++ b/addons/safemode/functions/fnc_lockSafety.sqf @@ -38,7 +38,7 @@ if (_unit getVariable [QGVAR(actionID), -1] == -1) then { _unit setVariable [QGVAR(actionID), [ _unit, "DefaultAction", { if ( - [_this select 1] call EFUNC(common,canUseWeapon) + [_this select 1] call CBA_fnc_canUseWeapon && { if (currentMuzzle (_this select 1) in ((_this select 1) getVariable [QGVAR(safedWeapons), []])) then { if (inputAction "nextWeapon" > 0) exitWith { diff --git a/addons/weaponselect/XEH_postInit.sqf b/addons/weaponselect/XEH_postInit.sqf index 87084ddf28..2e03982fec 100644 --- a/addons/weaponselect/XEH_postInit.sqf +++ b/addons/weaponselect/XEH_postInit.sqf @@ -8,7 +8,7 @@ if (!hasInterface) exitWith {}; // Conditions: canInteract if !([ACE_player, ACE_player, ["isNotInside", "isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; + if !([ACE_player] call CBA_fnc_canUseWeapon) exitWith {false}; // Statement [ACE_player, handgunWeapon ACE_player] call FUNC(selectWeaponMode); @@ -21,7 +21,7 @@ if (!hasInterface) exitWith {}; // Conditions: canInteract if !([ACE_player, ACE_player, ["isNotInside", "isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; + if !([ACE_player] call CBA_fnc_canUseWeapon) exitWith {false}; // Statement [ACE_player, primaryWeapon ACE_player] call FUNC(selectWeaponMode); @@ -34,7 +34,7 @@ if (!hasInterface) exitWith {}; // Conditions: canInteract if !([ACE_player, ACE_player, ["isNotInside", "isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; + if !([ACE_player] call CBA_fnc_canUseWeapon) exitWith {false}; // Statement [ACE_player, primaryWeapon ACE_player] call FUNC(selectWeaponMuzzle); @@ -47,7 +47,7 @@ if (!hasInterface) exitWith {}; // Conditions: canInteract if !([ACE_player, ACE_player, ["isNotInside", "isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; + if !([ACE_player] call CBA_fnc_canUseWeapon) exitWith {false}; // Statement [ACE_player, secondaryWeapon ACE_player] call FUNC(selectWeaponMode); @@ -60,7 +60,7 @@ if (!hasInterface) exitWith {}; // Conditions: canInteract if !([ACE_player, ACE_player, ["isNotInside", "isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; + if !([ACE_player] call CBA_fnc_canUseWeapon) exitWith {false}; // Statement [ACE_player, binocular ACE_player] call FUNC(selectWeaponMode); @@ -73,7 +73,7 @@ if (!hasInterface) exitWith {}; // Conditions: canInteract if !([ACE_player, ACE_player, ["isNotInside", "isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; + if !([ACE_player] call CBA_fnc_canUseWeapon) exitWith {false}; // Statement [ACE_player, 1] call FUNC(selectNextGrenade); @@ -86,7 +86,7 @@ if (!hasInterface) exitWith {}; // Conditions: canInteract if !([ACE_player, ACE_player, ["isNotInside", "isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; + if !([ACE_player] call CBA_fnc_canUseWeapon) exitWith {false}; // Statement [ACE_player, 2] call FUNC(selectNextGrenade); @@ -99,7 +99,7 @@ if (!hasInterface) exitWith {}; // Conditions: canInteract if !([ACE_player, ACE_player, ["isNotInside", "isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; + if !([ACE_player] call CBA_fnc_canUseWeapon) exitWith {false}; // Statement if ((currentWeapon ACE_player) != "") then {