mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Use the lovely CBA_fnc_canUseWeapon function
This commit is contained in:
parent
0d5385ffaf
commit
d464a23d21
@ -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
|
||||
|
@ -2,7 +2,6 @@
|
||||
PREP(adjustScope);
|
||||
PREP(adjustZero);
|
||||
PREP(applyScopeAdjustment);
|
||||
PREP(canAdjustScope);
|
||||
PREP(canAdjustZero);
|
||||
PREP(firedEH);
|
||||
PREP(getOptics);
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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)
|
Loading…
Reference in New Issue
Block a user