Use the lovely CBA_fnc_canUseWeapon function

This commit is contained in:
PabstMirror 2016-05-20 01:10:12 -05:00
parent 0d5385ffaf
commit d464a23d21
4 changed files with 9 additions and 41 deletions

View File

@ -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

View File

@ -2,7 +2,6 @@
PREP(adjustScope);
PREP(adjustZero);
PREP(applyScopeAdjustment);
PREP(canAdjustScope);
PREP(canAdjustZero);
PREP(firedEH);
PREP(getOptics);

View File

@ -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);

View File

@ -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 <OBJECT>
*
* Return value:
* <BOOL>
*
* 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)