From d464a23d21ae7d45834fc3aa5f06b1e2828eb1a9 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Fri, 20 May 2016 01:10:12 -0500 Subject: [PATCH] Use the lovely CBA_fnc_canUseWeapon function --- addons/fcs/functions/fnc_canUseFCS.sqf | 7 +---- addons/scopes/XEH_PREP.hpp | 1 - addons/scopes/XEH_postInit.sqf | 16 ++++++------ .../scopes/functions/fnc_canAdjustScope.sqf | 26 ------------------- 4 files changed, 9 insertions(+), 41 deletions(-) delete mode 100644 addons/scopes/functions/fnc_canAdjustScope.sqf diff --git a/addons/fcs/functions/fnc_canUseFCS.sqf b/addons/fcs/functions/fnc_canUseFCS.sqf index 1dcd1ca49e..3899584788 100644 --- a/addons/fcs/functions/fnc_canUseFCS.sqf +++ b/addons/fcs/functions/fnc_canUseFCS.sqf @@ -17,9 +17,4 @@ getNumber ([configFile >> "CfgVehicles" >> typeOf vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex)] call EFUNC(common,getTurretConfigPath) >> QGVAR(Enabled)) == 1 && {cameraView == "GUNNER"} -&& { - private _animationState = animationState ACE_player; - private _moves = configFile >> getText (configFile >> "CfgVehicles" >> (typeof ACE_player) >> "moves"); - - (getNumber (_moves >> "States" >> _animationState >> "canPullTrigger") == 0) -} +&& {!([ACE_player] call CBA_fnc_canUseWeapon)} //Not Turned Out diff --git a/addons/scopes/XEH_PREP.hpp b/addons/scopes/XEH_PREP.hpp index 05f58a5922..908d8064f0 100644 --- a/addons/scopes/XEH_PREP.hpp +++ b/addons/scopes/XEH_PREP.hpp @@ -2,7 +2,6 @@ PREP(adjustScope); PREP(adjustZero); PREP(applyScopeAdjustment); -PREP(canAdjustScope); PREP(canAdjustZero); PREP(firedEH); PREP(getOptics); diff --git a/addons/scopes/XEH_postInit.sqf b/addons/scopes/XEH_postInit.sqf index cc1d9e9c5c..1763bb7a32 100644 --- a/addons/scopes/XEH_postInit.sqf +++ b/addons/scopes/XEH_postInit.sqf @@ -35,7 +35,7 @@ if (!hasInterface) exitWith {}; // Conditions: canInteract if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if (!([ACE_player] call FUNC(canAdjustScope))) exitWith {false}; + if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; [ACE_player] call FUNC(inventoryCheck); @@ -50,7 +50,7 @@ if (!hasInterface) exitWith {}; // Conditions: canInteract if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if (!([ACE_player] call FUNC(canAdjustScope))) exitWith {false}; + if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; [ACE_player] call FUNC(inventoryCheck); @@ -65,7 +65,7 @@ if (!hasInterface) exitWith {}; // Conditions: canInteract if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if (!([ACE_player] call FUNC(canAdjustScope))) exitWith {false}; + if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; [ACE_player] call FUNC(inventoryCheck); @@ -80,7 +80,7 @@ if (!hasInterface) exitWith {}; // Conditions: canInteract if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if (!([ACE_player] call FUNC(canAdjustScope))) exitWith {false}; + if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; [ACE_player] call FUNC(inventoryCheck); @@ -95,7 +95,7 @@ if (!hasInterface) exitWith {}; // Conditions: canInteract if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if (!([ACE_player] call FUNC(canAdjustScope))) exitWith {false}; + if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; [ACE_player] call FUNC(inventoryCheck); @@ -110,7 +110,7 @@ if (!hasInterface) exitWith {}; // Conditions: canInteract if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if (!([ACE_player] call FUNC(canAdjustScope))) exitWith {false}; + if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; [ACE_player] call FUNC(inventoryCheck); @@ -125,7 +125,7 @@ if (!hasInterface) exitWith {}; // Conditions: canInteract if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if (!([ACE_player] call FUNC(canAdjustScope))) exitWith {false}; + if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; [ACE_player] call FUNC(inventoryCheck); @@ -140,7 +140,7 @@ if (!hasInterface) exitWith {}; // Conditions: canInteract if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if (!([ACE_player] call FUNC(canAdjustScope))) exitWith {false}; + if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; [ACE_player] call FUNC(inventoryCheck); diff --git a/addons/scopes/functions/fnc_canAdjustScope.sqf b/addons/scopes/functions/fnc_canAdjustScope.sqf deleted file mode 100644 index b5cc729cbb..0000000000 --- a/addons/scopes/functions/fnc_canAdjustScope.sqf +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Author: PabstMirror - * Tests if player would be in a position to adjust scope - * Mainly for determining edge cases with turned-out / FFV. - * - * Argument: - * 0: Unit - * - * Return value: - * - * - * Example: - * [player] call ace_scopes_fnc_canAdjustScope - * - * Public: No - */ -#include "script_component.hpp" - -params ["_unit"]; - -if ((vehicle _unit) == _unit) exitWith {true}; - -private _animationState = animationState _unit; -private _moves = configFile >> getText (configFile >> "CfgVehicles" >> (typeof _unit) >> "moves"); - -(getNumber (_moves >> "States" >> _animationState >> "canPullTrigger") == 1)