From 2105bc18db2d11d71782cc182ade12b781f72dc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Sun, 15 Feb 2015 17:43:57 -0300 Subject: [PATCH] Fixes for the FCS; it was missing a lot of `call`s before `FUNC`s. That made the rangefinder only work once. The flag for preventing holding is not needed becase GVAR(enabled) serving the same purpose. --- addons/fcs/functions/fnc_keyDown.sqf | 2 +- addons/fcs/initKeybinds.sqf | 15 ++++----------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/addons/fcs/functions/fnc_keyDown.sqf b/addons/fcs/functions/fnc_keyDown.sqf index 7699b82a20..5e2fabccc9 100644 --- a/addons/fcs/functions/fnc_keyDown.sqf +++ b/addons/fcs/functions/fnc_keyDown.sqf @@ -19,7 +19,7 @@ _turret = _this select 1; _distance = call FUNC(getRange); -if !(!GVAR(enabled) && FUNC(canUseFCS)) exitWith {}; +if !(!GVAR(enabled) && [] call FUNC(canUseFCS)) exitWith {}; GVAR(Enabled) = true; GVAR(Time) = time; diff --git a/addons/fcs/initKeybinds.sqf b/addons/fcs/initKeybinds.sqf index cbda9bdecc..b9ca0a927a 100644 --- a/addons/fcs/initKeybinds.sqf +++ b/addons/fcs/initKeybinds.sqf @@ -7,11 +7,7 @@ _exceptions = []; if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; // Conditions: specific - if !((!GVAR(enabled) && FUNC(canUseFCS)) || FUNC(canUseRangefinder)) exitWith {false}; - - // prevent holding down - if (GETGVAR(isDownStateKey1,false)) exitWith {false}; - GVAR(isDownStateKey1) = true; + if !((!GVAR(enabled) && [] call FUNC(canUseFCS)) || [] call FUNC(canUseRangefinder)) exitWith {false}; // Statement [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex)] call FUNC(keyDown); @@ -26,14 +22,11 @@ ["ACE3", localize "STR_ACE_FCS_LaseTarget", { - // prevent holding down - GVAR(isDownStateKey1) = false; - // Conditions: canInteract _exceptions = []; if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; // Conditions: specific - if !(GVAR(enabled) && FUNC(canUseFCS)) exitWith {false}; + if !(GVAR(enabled) && [] call FUNC(canUseFCS)) exitWith {false}; // Statement [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex)] call FUNC(keyUp); @@ -51,7 +44,7 @@ _exceptions = []; if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; // Conditions: specific - if !(FUNC(canUseFCS)) exitWith {false}; + if !([] call FUNC(canUseFCS)) exitWith {false}; // Statement [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), 50] call FUNC(adjustRange); @@ -69,7 +62,7 @@ _exceptions = []; if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; // Conditions: specific - if !(FUNC(canUseFCS)) exitWith {false}; + if !([] call FUNC(canUseFCS)) exitWith {false}; // Statement [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), -50] call FUNC(adjustRange);