From f73bdfa148cb186bdfeae3de162e88c2f14657c0 Mon Sep 17 00:00:00 2001 From: ulteq Date: Tue, 7 Apr 2015 19:20:38 +0200 Subject: [PATCH] Fixed several syntax errors in fnc_buttonPressed.sqf --- addons/kestrel4500/functions/fnc_buttonPressed.sqf | 8 ++++---- addons/kestrel4500/functions/fnc_collectData.sqf | 4 ++-- addons/kestrel4500/functions/fnc_generateOutputData.sqf | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/addons/kestrel4500/functions/fnc_buttonPressed.sqf b/addons/kestrel4500/functions/fnc_buttonPressed.sqf index 4db32ab40d..3f267ec7d4 100644 --- a/addons/kestrel4500/functions/fnc_buttonPressed.sqf +++ b/addons/kestrel4500/functions/fnc_buttonPressed.sqf @@ -18,7 +18,7 @@ switch (_this) do { case 0: { // Enter if (!GVAR(Kestrel4500_MinAvgMAx) && (GVAR(Kestrel4500_Menu) == 2 || GVAR(Kestrel4500_Menu) == 3)) then { - Kestrel4500_RefHeading = getDir ACE_player; + GVAR(Kestrel4500_RefHeading) = getDir ACE_player; }; if (GVAR(Kestrel4500_MinAvgMAx) && GVAR(Kestrel4500_Menu) > 0 && GVAR(Kestrel4500_Menu) < 4) then { if (GVAR(Kestrel4500_MinAvgMAxMode) != 1) then { @@ -29,14 +29,14 @@ switch (_this) do { GVAR(Kestrel4500_ENTRIES) set [_x, 0]; } forEach [1, 2, 3]; }; - GVAR(Kestrel4500_MinAvgMaxMode = (GVAR(Kestrel4500_MinAvgMaxMode + 1) % 3; + GVAR(Kestrel4500_MinAvgMaxMode) = GVAR(Kestrel4500_MinAvgMaxMode + 1) % 3; }; }; case 1: { // Top - GVAR(Kestrel4500_Menu) = (GVAR(Kestrel4500_Menu) - 1 + (count GVAR(Kestrel4500_Menu)s)) % (count GVAR(Kestrel4500_Menu)s); + GVAR(Kestrel4500_Menu) = (GVAR(Kestrel4500_Menu) - 1 + (count GVAR(Kestrel4500_Menus))) % (count GVAR(Kestrel4500_Menus)); }; case 2: { // Bottom - GVAR(Kestrel4500_Menu) = (GVAR(Kestrel4500_Menu) + 1 + (count GVAR(Kestrel4500_Menu)s)) % (count GVAR(Kestrel4500_Menu)s); + GVAR(Kestrel4500_Menu) = (GVAR(Kestrel4500_Menu) + 1 + (count GVAR(Kestrel4500_Menus))) % (count GVAR(Kestrel4500_Menus)); }; case 3: { // Left GVAR(Kestrel4500_MinAvgMaxMode) = !GVAR(Kestrel4500_MinAvgMaxMode); diff --git a/addons/kestrel4500/functions/fnc_collectData.sqf b/addons/kestrel4500/functions/fnc_collectData.sqf index ca1a694184..8692ba8118 100644 --- a/addons/kestrel4500/functions/fnc_collectData.sqf +++ b/addons/kestrel4500/functions/fnc_collectData.sqf @@ -57,13 +57,13 @@ if (GVAR(Kestrel4500_MinAvgMaxMode) == 1) then { GVAR(Kestrel4500_TOTAL) set [1, (GVAR(Kestrel4500_TOTAL) select 1) + abs(_windSpeed)]; // CROSSWIND - _crosswind = abs(sin(Kestrel4500_RefHeading - _playerDir) * _windSpeed); + _crosswind = abs(sin(GVAR(Kestrel4500_RefHeading) - _playerDir) * _windSpeed); GVAR(Kestrel4500_MIN) set [2, (GVAR(Kestrel4500_MIN) select 2) min _crosswind]; GVAR(Kestrel4500_MAX) set [2, _crosswind max (GVAR(Kestrel4500_MAX) select 2)]; GVAR(Kestrel4500_TOTAL) set [2, (GVAR(Kestrel4500_TOTAL) select 2) + _crosswind]; // HEADWIND - _headwind = abs(cos(Kestrel4500_RefHeading - _playerDir) * _windSpeed); + _headwind = abs(cos(GVAR(Kestrel4500_RefHeading) - _playerDir) * _windSpeed); GVAR(Kestrel4500_MIN) set [3, (GVAR(Kestrel4500_MIN) select 3) min _headwind]; GVAR(Kestrel4500_MAX) set [3, _headwind max (GVAR(Kestrel4500_MAX) select 3)]; GVAR(Kestrel4500_TOTAL) set [3, (GVAR(Kestrel4500_TOTAL) select 3) + _headwind]; diff --git a/addons/kestrel4500/functions/fnc_generateOutputData.sqf b/addons/kestrel4500/functions/fnc_generateOutputData.sqf index f0cfa43a90..5aa2d91758 100644 --- a/addons/kestrel4500/functions/fnc_generateOutputData.sqf +++ b/addons/kestrel4500/functions/fnc_generateOutputData.sqf @@ -94,7 +94,7 @@ switch (GVAR(Kestrel4500_Menu)) do { }; case 2: { // CROSSWIND if (!GVAR(Kestrel4500_MinAvgMax)) then { - _textCenterBig = Str(round(abs(sin(Kestrel4500_RefHeading - _playerDir) * _windSpeed) * 10) / 10); + _textCenterBig = Str(round(abs(sin(GVAR(Kestrel4500_RefHeading) - _playerDir) * _windSpeed) * 10) / 10); _textInfoLine1 = format["%1 m/s @ %2", round((cos(_playerDir - _windDir) * _windSpeed) * 10) / 10, round(_playerDir)]; _textInfoLine2 = "- set heading"; } else { @@ -121,7 +121,7 @@ switch (GVAR(Kestrel4500_Menu)) do { }; case 3: { // HEADWIND if (!GVAR(Kestrel4500_MinAvgMax)) then { - _textCenterBig = Str(round(abs(cos(Kestrel4500_RefHeading - _playerDir) * _windSpeed) * 10) / 10); + _textCenterBig = Str(round(abs(cos(GVAR(Kestrel4500_RefHeading) - _playerDir) * _windSpeed) * 10) / 10); _textInfoLine1 = format["%1 m/s @ %2", round((cos(_playerDir - _windDir) * _windSpeed) * 10) / 10, round(_playerDir)]; _textInfoLine2 = "- set heading"; } else {