Non-hardcoded binocular / vector detection

This commit is contained in:
PabstMirror 2016-04-20 10:40:00 -05:00
parent 23632281cf
commit cf9479efab
4 changed files with 5 additions and 5 deletions

View File

@ -88,7 +88,7 @@ if (GVAR(ammoTemperatureEnabled) || GVAR(barrelLengthInfluenceEnabled)) then {
_bulletTraceVisible = false;
if (GVAR(bulletTraceEnabled) && cameraView == "GUNNER") then {
if (currentWeapon ACE_player in ["ACE_Vector", "ACE_VectorDay", "Binocular", "Rangefinder", "Laserdesignator"]) then {
if ((currentWeapon ACE_player == binocular ACE_player) && {binocular ACE_player != ""}) then {
_bulletTraceVisible = true;
} else {
if (currentWeapon ACE_player == primaryWeapon ACE_player && count primaryWeaponItems ACE_player > 2) then {

View File

@ -522,7 +522,7 @@ GVAR(menuRun) = true;
(__dsp displayCtrl __mainText) ctrlSetText "Connecting...";
};
if (ACE_time - GVAR(busyTimer) > 0.6) then {
if ((ACE_player hasWeapon "ACE_Vector") || {ACE_player hasWeapon "ACE_VectorDay"}) then {
if (({_x isKindOf ["ACE_Vector", configFile >> "CfgWeapons"]} count (weapons ACE_player)) > 0) then {
GVAR(displaySelection) = "VECTOR";
(__dsp displayCtrl __mainText) ctrlSetText "Vector Connected";
GVAR(vectorConnected) = true;

View File

@ -7,7 +7,7 @@ PFH executed while holding a vector key down.
*/
#include "script_component.hpp"
if (!(currentWeapon ACE_player in ["ACE_Vector", "ACE_VectorDay"])) exitWith {
if (!((currentWeapon ACE_player) isKindOf ["ACE_Vector", configFile >> "CfgWeapons"])) exitWith {
[_this select 1] call CBA_fnc_removePerFrameHandler;
GVAR(currentMode) = "";

View File

@ -5,7 +5,7 @@
// Conditions: canInteract
if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false};
// Conditions: specific
if !((currentWeapon ACE_player in ["ACE_Vector", "ACE_VectorDay"]) && {cameraView == "GUNNER"}) exitWith {false};
if !(((currentWeapon ACE_player) isKindOf ["ACE_Vector", configFile >> "CfgWeapons"]) && {cameraView == "GUNNER"}) exitWith {false};
// prevent holding down
if (GETGVAR(isDownStateKey1,false)) exitWith {false};
@ -34,7 +34,7 @@
// Conditions: canInteract
if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false};
// Conditions: specific
if !((currentWeapon ACE_player in ["ACE_Vector", "ACE_VectorDay"]) && {cameraView == "GUNNER"}) exitWith {false};
if !(((currentWeapon ACE_player) isKindOf ["ACE_Vector", configFile >> "CfgWeapons"]) && {cameraView == "GUNNER"}) exitWith {false};
// prevent holding down
if (GETGVAR(isDownStateKey2,false)) exitWith {false};