From 18d864e9504154e24a265886fd81b270220e4280 Mon Sep 17 00:00:00 2001
From: bux578 <github@jonathandavid.de>
Date: Sat, 11 Jun 2016 21:13:51 +0200
Subject: [PATCH 1/5] split mapData into separate function

---
 addons/common/XEH_PREP.hpp                  |  1 +
 addons/common/functions/fnc_getMGRSdata.sqf | 81 ++---------------
 addons/common/functions/fnc_getMapData.sqf  | 97 +++++++++++++++++++++
 3 files changed, 103 insertions(+), 76 deletions(-)
 create mode 100644 addons/common/functions/fnc_getMapData.sqf

diff --git a/addons/common/XEH_PREP.hpp b/addons/common/XEH_PREP.hpp
index 0af9fa0ab9..4f56dd4d86 100644
--- a/addons/common/XEH_PREP.hpp
+++ b/addons/common/XEH_PREP.hpp
@@ -60,6 +60,7 @@ PREP(getFirstTerrainIntersection);
 PREP(getForceWalkStatus);
 PREP(getGunner);
 PREP(getInPosition);
+PREP(getMapData);
 PREP(getMapGridData);
 PREP(getMapGridFromPos);
 PREP(getMapPosFromGrid);
diff --git a/addons/common/functions/fnc_getMGRSdata.sqf b/addons/common/functions/fnc_getMGRSdata.sqf
index 44fc204638..6c039fe2b5 100644
--- a/addons/common/functions/fnc_getMGRSdata.sqf
+++ b/addons/common/functions/fnc_getMGRSdata.sqf
@@ -22,83 +22,12 @@ private _long = getNumber (configFile >> "CfgWorlds" >> _map >> "longitude");
 private _lat =  getNumber (configFile >> "CfgWorlds" >> _map >> "latitude");
 private _altitude =  getNumber (configFile >> "CfgWorlds" >> _map >> "elevationOffset");
 
-_map = toLower _map;
-if (_map in ["abbottabad"]) then { _lat = 34; _altitude = 1256; };    //Abbottabad elevation 1256m (Wikipedia)
-if (_map in ["abramia"]) then { _lat = 60; _altitude = 0; };
-if (_map in ["af_kandahar_province"]) then { _lat = 42; _altitude = 0; };
-if (_map in ["altis"]) then { _lat = 40; _altitude = 0; };
-if (_map in ["angel"]) then { _lat = 38; _altitude = 0; };
-if (_map in ["anim_helvantis_v2"]) then { _lat = 50; _altitude = 0; };
-if (_map in ["australia"]) then { _lat = -25; _altitude = 0; };
-if (_map in ["bootcamp_acr"]) then { _lat = 50; _altitude = 0; };
-if (_map in ["bornholm"]) then { _lat = 55; _altitude = 0; };
-if (_map in ["bozcaada"]) then { _lat = 40; _altitude = 0; };
-if (_map in ["caribou"]) then { _lat = 68; _altitude = 0; };
-if (_map in ["catalina"]) then { _lat = 33; _altitude = 0; };
-if (_map in ["chernarus", "chernarus_summer", "chernarus_winter"]) then { _lat = 50; _altitude = 0; };
-if (_map in ["chernobylzone", "chernobylzonea2"]) then { _lat = 51; _altitude = 0; };
-if (_map in ["clafghan"]) then { _lat = 34; _altitude = 640; };
-if (_map in ["dakrong"]) then { _lat = 17; _altitude = 0; };    //Unsung Mod
-if (_map in ["desert_e"]) then { _lat = 40; _altitude = 800; };
-if (_map in ["dya"]) then { _lat = 34; _altitude = 110; };    //Diyala Iraq - default elevationOffset
-if (_map in ["esseker"]) then { _lat = 43; _altitude = 2000; };
-if (_map in ["evergreen"]) then { _lat = 41; _altitude = 0; };    //Burgazada, Turkey - default elevationOffset
-if (_map in ["fallujah"]) then { _lat = 33; _altitude = 0; };
-if (_map in ["fata"]) then { _lat = 33; _altitude = 1347; };
-if (_map in ["gorgona"]) then { _lat = 43; _altitude = 0; };
-if (_map in ["hellskitchen", "hellskitchens"]) then { _lat = 32; _altitude = 900; };    //Sangin summer, Sangin winter - Sangin elevation 888m (Wikipedia)
-if (_map in ["hindukush"]) then { _lat = 36; _altitude = 0; };
-if (_map in ["imrali", "imralispring"]) then { _lat = 40; _altitude = 0; };
-if (_map in ["intro"]) then { _lat = 40; _altitude = 0; };
-if (_map in ["isladuala3"]) then { _lat = -19; _altitude = 0; };
-if (_map in ["jacobi"]) then { _lat = 34; _altitude = 2000; };    //default elevationOffset     
-if (_map in ["kapaulio"]) then { _lat = 0; _altitude = 0; };
-if (_map in ["kerama"]) then { _lat = 26; _altitude = 0; };    //Kerama Islands, Japan - default elevationOffset
-if (_map in ["kholm"]) then { _lat = 36; _altitude = 0; };
-if (_map in ["koplic"]) then { _lat = 42; _altitude = 0; };
-if (_map in ["kunduz"]) then { _lat = 37; _altitude = 0; };
-if (_map in ["lingor", "lingor3"]) then { _lat = -4; _altitude = 0; };
-if (_map in ["lost", "lostw"]) then { _lat = 60; _altitude = 0; };
-if (_map in ["mcn_aliabad"]) then { _lat = 36; _altitude = 0; };
-if (_map in ["malvinas"]) then { _lat = -52; _altitude = 0; };
-if (_map in ["namalsk"]) then { _lat = 65; _altitude = 0; };
-if (_map in ["mef_alaska"]) then { _lat = 60; _altitude = 5; };
-if (_map in ["mountains_acr"]) then { _lat = 35; _altitude = 2000; };
-if (_map in ["napf", "napfwinter"]) then { _lat = 47; _altitude = 0; };
-if (_map in ["panthera3"]) then { _lat = 46; _altitude = 0; };
-if (_map in ["pianosa_aut"]) then { _lat = 43; _altitude = 0; };    //Pianosa, Italy - default elevationOffset
-if (_map in ["pja305"]) then { _lat = 0; _altitude = 0; };    //G.O.S N'Ziwasogo
-if (_map in ["pja306"]) then { _lat = 35; _altitude = 0; };    //G.O.S Kalu Khan
-if (_map in ["pja307"]) then { _lat = 17; _altitude = 0; };    //F.S.F Daryah
-if (_map in ["pja308"]) then { _lat = 36; _altitude = 0; };    //G.O.S Gunkizli
-if (_map in ["pja310"]) then { _lat = 36; _altitude = 0; };    //G.O.S Al Rayak
-if (_map in ["pja312"]) then { _lat = 16; _altitude = 0; };    //G.O.S Song Bin Tanh
-if (_map in ["porquerolles"]) then { _lat = 43; _altitude = 0; };
-if (_map in ["porto"]) then { _lat = 40; _altitude = 0; };
-if (_map in ["provinggrounds_pmc"]) then { _lat = 35; _altitude = 100; };
-if (_map in ["reshmaan"]) then { _lat = 35; _altitude = 2000; };
-if (_map in ["sara", "sara_dbe1"]) then { _lat = 40; _altitude = 0; };
-if (_map in ["saralite"]) then { _lat = 40; _altitude = 0; };
-if (_map in ["sb3"]) then { _lat = 53; _altitude = 25; };    //TrpUebPl Einfelde Nord (Munster North Training Area, Germany) - default elevationOffset
-if (_map in ["shapur_baf"]) then { _lat = 35; _altitude = 100; };
-if (_map in ["sfp_sturko"]) then { _lat = 56; _altitude = 0; };
-if (_map in ["sfp_wamako"]) then { _lat = 14; _altitude = 0; };
-if (_map in ["stratis"]) then { _lat = 40; _altitude = 0; };
-if (_map in ["sugarlake"]) then { _lat = 29; _altitude = 0; };
-if (_map in ["takistan"]) then { _lat = 35; _altitude = 2000; };
-if (_map in ["thirsk"]) then { _lat = 65; _altitude = 0; };
-if (_map in ["tilos"]) then { _lat = 36; _altitude = 0; };
-if (_map in ["utes"]) then { _lat = 50; _altitude = 0; };
-if (_map in ["vt5"]) then { _lat = 61; _altitude = 100; };    //Vt5, Suomi Finland - default elevationOffset
-if (_map in ["wake"]) then { _lat = 19; _altitude = 0; };
-if (_map in ["waziristan"]) then { _lat = 33; _altitude = 0; };
-if (_map in ["wintermap"]) then { _lat = 61; _altitude = 0; };    //Nordkvingo - default elevationOffset
-if (_map in ["wintertown", "wintertowna3"]) then { _lat = 39; _altitude = 600; };    //U.S. state Kansas mean elevation 610m (Wikipedia)
-if (_map in ["woodland_acr"]) then { _lat = 50; _altitude = 0; };
-if (_map in ["xcam_prototype"]) then { _lat = 35; _altitude = 0; };
-if (_map in ["zargabad"]) then { _lat = 35; _altitude = 2000; };
+private _mapData = _map call FUNC(getMapData);
+_lat = _mapData select 0;
+_alt = _mapData select 1;
+TRACE_2("Latitude and Altitude",_lat,_alt);
 
-private _UTM = [_long,_lat] call BIS_fnc_posDegToUTM;
+private _UTM = [_long, _lat] call BIS_fnc_posDegToUTM;
 private _easting = _UTM select 0;
 private _northing = _UTM select 1;
 //private _zone = _UTM select 2;
diff --git a/addons/common/functions/fnc_getMapData.sqf b/addons/common/functions/fnc_getMapData.sqf
new file mode 100644
index 0000000000..d19802bbc3
--- /dev/null
+++ b/addons/common/functions/fnc_getMapData.sqf
@@ -0,0 +1,97 @@
+/*
+ * Author: VKing, bux
+ * Gets the current latitude and altitude offset for the map.
+ *
+ * Argument:
+ * 0: Map name (default: worldName) <STRING>
+ *
+ * Return Value:
+ * 0: Latitude <NUMBER>
+ * 1: Altitude <NUMBER>
+ *
+ * Public: No
+ */
+
+ _map = toLower _this;
+
+// [latitude, altitude]
+
+// the more important ones
+
+if (_map in ["altis"]) exitWith { [40, 0] };
+if (_map in ["stratis"]) exitWith { [40, 0] };
+
+ if (_map in ["abbottabad"]) exitWith { [34, 1256] };    //Abbottabad elevation 1256m (Wikipedia)
+ if (_map in ["abramia"]) exitWith { [60, 0] };
+ if (_map in ["af_kandahar_province"]) exitWith { [42, 0] };
+ if (_map in ["angel"]) exitWith { [38, 0] };
+ if (_map in ["anim_helvantis_v2"]) exitWith { [50, 0] };
+ if (_map in ["australia"]) exitWith { _lat = -25; _altitude = 0; };
+ if (_map in ["bootcamp_acr"]) exitWith { [50, 0] };
+ if (_map in ["bornholm"]) exitWith { [55, 0] };
+ if (_map in ["bozcaada"]) exitWith { [40, 0] };
+ if (_map in ["caribou"]) exitWith { [68, 0] };
+ if (_map in ["catalina"]) exitWith { [33, 0] };
+ if (_map in ["chernarus", "chernarus_summer", "chernarus_winter"]) exitWith { [50, 0] };
+ if (_map in ["chernobylzone", "chernobylzonea2"]) exitWith { [51, 0] };
+ if (_map in ["clafghan"]) exitWith { [34, 640] };
+ if (_map in ["dakrong"]) exitWith { [17, 0] };    //Unsung Mod
+ if (_map in ["desert_e"]) exitWith { [40, 800] };
+ if (_map in ["dya"]) exitWith { [34, 110] };    //Diyala Iraq - default elevationOffset
+ if (_map in ["esseker"]) exitWith { [43, 2000] };
+ if (_map in ["evergreen"]) exitWith { [41, 0] };    //Burgazada, Turkey - default elevationOffset
+ if (_map in ["fallujah"]) exitWith { [33, 0] };
+ if (_map in ["fata"]) exitWith { [33, 1347] };
+ if (_map in ["gorgona"]) exitWith { [43, 0] };
+ if (_map in ["hellskitchen", "hellskitchens"]) exitWith { [32, 900] };    //Sangin summer, Sangin winter - Sangin elevation 888m (Wikipedia)
+ if (_map in ["hindukush"]) exitWith { [36, 0] };
+ if (_map in ["imrali", "imralispring"]) exitWith { [40, 0] };
+ if (_map in ["intro"]) exitWith { [40, 0] };
+ if (_map in ["isladuala3"]) exitWith { _lat = -19; _altitude = 0; };
+ if (_map in ["jacobi"]) exitWith { [34, 2000] };    //default elevationOffset
+ if (_map in ["kapaulio"]) exitWith { [0, 0] };
+ if (_map in ["kerama"]) exitWith { [26, 0] };    //Kerama Islands, Japan - default elevationOffset
+ if (_map in ["kholm"]) exitWith { [36, 0] };
+ if (_map in ["koplic"]) exitWith { [42, 0] };
+ if (_map in ["kunduz"]) exitWith { [37, 0] };
+ if (_map in ["lingor", "lingor3"]) exitWith { _lat = -4; _altitude = 0; };
+ if (_map in ["lost", "lostw"]) exitWith { [60, 0] };
+ if (_map in ["mcn_aliabad"]) exitWith { [36, 0] };
+ if (_map in ["malvinas"]) exitWith { _lat = -52; _altitude = 0; };
+ if (_map in ["namalsk"]) exitWith { [65, 0] };
+ if (_map in ["mef_alaska"]) exitWith { [60, 5] };
+ if (_map in ["mountains_acr"]) exitWith { [35, 2000] };
+ if (_map in ["napf", "napfwinter"]) exitWith { [47, 0] };
+ if (_map in ["panthera3"]) exitWith { [46, 0] };
+ if (_map in ["pianosa_aut"]) exitWith { [43, 0] };    //Pianosa, Italy - default elevationOffset
+ if (_map in ["pja305"]) exitWith { [0, 0] };    //G.O.S N'Ziwasogo
+ if (_map in ["pja306"]) exitWith { [35, 0] };    //G.O.S Kalu Khan
+ if (_map in ["pja307"]) exitWith { [17, 0] };    //F.S.F Daryah
+ if (_map in ["pja308"]) exitWith { [36, 0] };    //G.O.S Gunkizli
+ if (_map in ["pja310"]) exitWith { [36, 0] };    //G.O.S Al Rayak
+ if (_map in ["pja312"]) exitWith { [16, 0] };    //G.O.S Song Bin Tanh
+ if (_map in ["porquerolles"]) exitWith { [43, 0] };
+ if (_map in ["porto"]) exitWith { [40, 0] };
+ if (_map in ["provinggrounds_pmc"]) exitWith { [35, 100] };
+ if (_map in ["reshmaan"]) exitWith { [35, 2000] };
+ if (_map in ["sara", "sara_dbe1"]) exitWith { [40, 0] };
+ if (_map in ["saralite"]) exitWith { [40, 0] };
+ if (_map in ["sb3"]) exitWith { [53, 25] };    //TrpUebPl Einfelde Nord (Munster North Training Area, Germany) - default elevationOffset
+ if (_map in ["shapur_baf"]) exitWith { [35, 100] };
+ if (_map in ["sfp_sturko"]) exitWith { [56, 0] };
+ if (_map in ["sfp_wamako"]) exitWith { [14, 0] };
+ if (_map in ["sugarlake"]) exitWith { [29, 0] };
+ if (_map in ["takistan"]) exitWith { [35, 2000] };
+ if (_map in ["thirsk"]) exitWith { [65, 0] };
+ if (_map in ["tilos"]) exitWith { [36, 0] };
+ if (_map in ["utes"]) exitWith { [50, 0] };
+ if (_map in ["vt5"]) exitWith { [61, 100] };    //Vt5, Suomi Finland - default elevationOffset
+ if (_map in ["wake"]) exitWith { [19, 0] };
+ if (_map in ["waziristan"]) exitWith { [33, 0] };
+ if (_map in ["wintermap"]) exitWith { [61, 0] };    //Nordkvingo - default elevationOffset
+ if (_map in ["wintertown", "wintertowna3"]) exitWith { [39, 600] };    //U.S. state Kansas mean elevation 610m (Wikipedia)
+ if (_map in ["woodland_acr"]) exitWith { [50, 0] };
+ if (_map in ["xcam_prototype"]) exitWith { [35, 0] };
+ if (_map in ["zargabad"]) exitWith { [35, 2000] };
+
+[0, 0]

From c268572649d372e0a6220de54bee1559c189401f Mon Sep 17 00:00:00 2001
From: bux578 <github@jonathandavid.de>
Date: Sat, 11 Jun 2016 21:14:05 +0200
Subject: [PATCH 2/5] add Tanoa mapData

---
 addons/common/functions/fnc_getMapData.sqf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/addons/common/functions/fnc_getMapData.sqf b/addons/common/functions/fnc_getMapData.sqf
index d19802bbc3..469250d9a8 100644
--- a/addons/common/functions/fnc_getMapData.sqf
+++ b/addons/common/functions/fnc_getMapData.sqf
@@ -17,7 +17,7 @@
 // [latitude, altitude]
 
 // the more important ones
-
+if (_map in ["tanoa"]) exitWith { [-18, 0] };
 if (_map in ["altis"]) exitWith { [40, 0] };
 if (_map in ["stratis"]) exitWith { [40, 0] };
 

From 4f73ead80c0b41a114ae0fb932e7622b5f4a48db Mon Sep 17 00:00:00 2001
From: PabstMirror <pabstmirror@gmail.com>
Date: Sat, 11 Jun 2016 14:32:36 -0500
Subject: [PATCH 3/5] Fix alt/lat for maps not defined in getMapData

---
 addons/common/functions/fnc_getMGRSdata.sqf | 6 ++++--
 addons/common/functions/fnc_getMapData.sqf  | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/addons/common/functions/fnc_getMGRSdata.sqf b/addons/common/functions/fnc_getMGRSdata.sqf
index 6c039fe2b5..a2a9756e23 100644
--- a/addons/common/functions/fnc_getMGRSdata.sqf
+++ b/addons/common/functions/fnc_getMGRSdata.sqf
@@ -23,8 +23,10 @@ private _lat =  getNumber (configFile >> "CfgWorlds" >> _map >> "latitude");
 private _altitude =  getNumber (configFile >> "CfgWorlds" >> _map >> "elevationOffset");
 
 private _mapData = _map call FUNC(getMapData);
-_lat = _mapData select 0;
-_alt = _mapData select 1;
+if (!(_mapData isEqualTo [])) then {
+    _lat = _mapData select 0;
+    _alt = _mapData select 1;
+};
 TRACE_2("Latitude and Altitude",_lat,_alt);
 
 private _UTM = [_long, _lat] call BIS_fnc_posDegToUTM;
diff --git a/addons/common/functions/fnc_getMapData.sqf b/addons/common/functions/fnc_getMapData.sqf
index 469250d9a8..188d5cfed8 100644
--- a/addons/common/functions/fnc_getMapData.sqf
+++ b/addons/common/functions/fnc_getMapData.sqf
@@ -94,4 +94,4 @@ if (_map in ["stratis"]) exitWith { [40, 0] };
  if (_map in ["xcam_prototype"]) exitWith { [35, 0] };
  if (_map in ["zargabad"]) exitWith { [35, 2000] };
 
-[0, 0]
+[] //Return empty array if we have no specific data for the map

From d57754a7cd42e14b2eead3bd34f532bfb6a14937 Mon Sep 17 00:00:00 2001
From: PabstMirror <pabstmirror@gmail.com>
Date: Sat, 11 Jun 2016 14:34:14 -0500
Subject: [PATCH 4/5] Private/Formatting

---
 addons/common/functions/fnc_getMapData.sqf | 147 +++++++++++----------
 1 file changed, 74 insertions(+), 73 deletions(-)

diff --git a/addons/common/functions/fnc_getMapData.sqf b/addons/common/functions/fnc_getMapData.sqf
index 188d5cfed8..f52e6dbdc7 100644
--- a/addons/common/functions/fnc_getMapData.sqf
+++ b/addons/common/functions/fnc_getMapData.sqf
@@ -12,7 +12,8 @@
  * Public: No
  */
 
- _map = toLower _this;
+params ["_map"];
+_map = toLower _map;
 
 // [latitude, altitude]
 
@@ -21,77 +22,77 @@ if (_map in ["tanoa"]) exitWith { [-18, 0] };
 if (_map in ["altis"]) exitWith { [40, 0] };
 if (_map in ["stratis"]) exitWith { [40, 0] };
 
- if (_map in ["abbottabad"]) exitWith { [34, 1256] };    //Abbottabad elevation 1256m (Wikipedia)
- if (_map in ["abramia"]) exitWith { [60, 0] };
- if (_map in ["af_kandahar_province"]) exitWith { [42, 0] };
- if (_map in ["angel"]) exitWith { [38, 0] };
- if (_map in ["anim_helvantis_v2"]) exitWith { [50, 0] };
- if (_map in ["australia"]) exitWith { _lat = -25; _altitude = 0; };
- if (_map in ["bootcamp_acr"]) exitWith { [50, 0] };
- if (_map in ["bornholm"]) exitWith { [55, 0] };
- if (_map in ["bozcaada"]) exitWith { [40, 0] };
- if (_map in ["caribou"]) exitWith { [68, 0] };
- if (_map in ["catalina"]) exitWith { [33, 0] };
- if (_map in ["chernarus", "chernarus_summer", "chernarus_winter"]) exitWith { [50, 0] };
- if (_map in ["chernobylzone", "chernobylzonea2"]) exitWith { [51, 0] };
- if (_map in ["clafghan"]) exitWith { [34, 640] };
- if (_map in ["dakrong"]) exitWith { [17, 0] };    //Unsung Mod
- if (_map in ["desert_e"]) exitWith { [40, 800] };
- if (_map in ["dya"]) exitWith { [34, 110] };    //Diyala Iraq - default elevationOffset
- if (_map in ["esseker"]) exitWith { [43, 2000] };
- if (_map in ["evergreen"]) exitWith { [41, 0] };    //Burgazada, Turkey - default elevationOffset
- if (_map in ["fallujah"]) exitWith { [33, 0] };
- if (_map in ["fata"]) exitWith { [33, 1347] };
- if (_map in ["gorgona"]) exitWith { [43, 0] };
- if (_map in ["hellskitchen", "hellskitchens"]) exitWith { [32, 900] };    //Sangin summer, Sangin winter - Sangin elevation 888m (Wikipedia)
- if (_map in ["hindukush"]) exitWith { [36, 0] };
- if (_map in ["imrali", "imralispring"]) exitWith { [40, 0] };
- if (_map in ["intro"]) exitWith { [40, 0] };
- if (_map in ["isladuala3"]) exitWith { _lat = -19; _altitude = 0; };
- if (_map in ["jacobi"]) exitWith { [34, 2000] };    //default elevationOffset
- if (_map in ["kapaulio"]) exitWith { [0, 0] };
- if (_map in ["kerama"]) exitWith { [26, 0] };    //Kerama Islands, Japan - default elevationOffset
- if (_map in ["kholm"]) exitWith { [36, 0] };
- if (_map in ["koplic"]) exitWith { [42, 0] };
- if (_map in ["kunduz"]) exitWith { [37, 0] };
- if (_map in ["lingor", "lingor3"]) exitWith { _lat = -4; _altitude = 0; };
- if (_map in ["lost", "lostw"]) exitWith { [60, 0] };
- if (_map in ["mcn_aliabad"]) exitWith { [36, 0] };
- if (_map in ["malvinas"]) exitWith { _lat = -52; _altitude = 0; };
- if (_map in ["namalsk"]) exitWith { [65, 0] };
- if (_map in ["mef_alaska"]) exitWith { [60, 5] };
- if (_map in ["mountains_acr"]) exitWith { [35, 2000] };
- if (_map in ["napf", "napfwinter"]) exitWith { [47, 0] };
- if (_map in ["panthera3"]) exitWith { [46, 0] };
- if (_map in ["pianosa_aut"]) exitWith { [43, 0] };    //Pianosa, Italy - default elevationOffset
- if (_map in ["pja305"]) exitWith { [0, 0] };    //G.O.S N'Ziwasogo
- if (_map in ["pja306"]) exitWith { [35, 0] };    //G.O.S Kalu Khan
- if (_map in ["pja307"]) exitWith { [17, 0] };    //F.S.F Daryah
- if (_map in ["pja308"]) exitWith { [36, 0] };    //G.O.S Gunkizli
- if (_map in ["pja310"]) exitWith { [36, 0] };    //G.O.S Al Rayak
- if (_map in ["pja312"]) exitWith { [16, 0] };    //G.O.S Song Bin Tanh
- if (_map in ["porquerolles"]) exitWith { [43, 0] };
- if (_map in ["porto"]) exitWith { [40, 0] };
- if (_map in ["provinggrounds_pmc"]) exitWith { [35, 100] };
- if (_map in ["reshmaan"]) exitWith { [35, 2000] };
- if (_map in ["sara", "sara_dbe1"]) exitWith { [40, 0] };
- if (_map in ["saralite"]) exitWith { [40, 0] };
- if (_map in ["sb3"]) exitWith { [53, 25] };    //TrpUebPl Einfelde Nord (Munster North Training Area, Germany) - default elevationOffset
- if (_map in ["shapur_baf"]) exitWith { [35, 100] };
- if (_map in ["sfp_sturko"]) exitWith { [56, 0] };
- if (_map in ["sfp_wamako"]) exitWith { [14, 0] };
- if (_map in ["sugarlake"]) exitWith { [29, 0] };
- if (_map in ["takistan"]) exitWith { [35, 2000] };
- if (_map in ["thirsk"]) exitWith { [65, 0] };
- if (_map in ["tilos"]) exitWith { [36, 0] };
- if (_map in ["utes"]) exitWith { [50, 0] };
- if (_map in ["vt5"]) exitWith { [61, 100] };    //Vt5, Suomi Finland - default elevationOffset
- if (_map in ["wake"]) exitWith { [19, 0] };
- if (_map in ["waziristan"]) exitWith { [33, 0] };
- if (_map in ["wintermap"]) exitWith { [61, 0] };    //Nordkvingo - default elevationOffset
- if (_map in ["wintertown", "wintertowna3"]) exitWith { [39, 600] };    //U.S. state Kansas mean elevation 610m (Wikipedia)
- if (_map in ["woodland_acr"]) exitWith { [50, 0] };
- if (_map in ["xcam_prototype"]) exitWith { [35, 0] };
- if (_map in ["zargabad"]) exitWith { [35, 2000] };
+if (_map in ["abbottabad"]) exitWith { [34, 1256] };    //Abbottabad elevation 1256m (Wikipedia)
+if (_map in ["abramia"]) exitWith { [60, 0] };
+if (_map in ["af_kandahar_province"]) exitWith { [42, 0] };
+if (_map in ["angel"]) exitWith { [38, 0] };
+if (_map in ["anim_helvantis_v2"]) exitWith { [50, 0] };
+if (_map in ["australia"]) exitWith { _lat = -25; _altitude = 0; };
+if (_map in ["bootcamp_acr"]) exitWith { [50, 0] };
+if (_map in ["bornholm"]) exitWith { [55, 0] };
+if (_map in ["bozcaada"]) exitWith { [40, 0] };
+if (_map in ["caribou"]) exitWith { [68, 0] };
+if (_map in ["catalina"]) exitWith { [33, 0] };
+if (_map in ["chernarus", "chernarus_summer", "chernarus_winter"]) exitWith { [50, 0] };
+if (_map in ["chernobylzone", "chernobylzonea2"]) exitWith { [51, 0] };
+if (_map in ["clafghan"]) exitWith { [34, 640] };
+if (_map in ["dakrong"]) exitWith { [17, 0] };    //Unsung Mod
+if (_map in ["desert_e"]) exitWith { [40, 800] };
+if (_map in ["dya"]) exitWith { [34, 110] };    //Diyala Iraq - default elevationOffset
+if (_map in ["esseker"]) exitWith { [43, 2000] };
+if (_map in ["evergreen"]) exitWith { [41, 0] };    //Burgazada, Turkey - default elevationOffset
+if (_map in ["fallujah"]) exitWith { [33, 0] };
+if (_map in ["fata"]) exitWith { [33, 1347] };
+if (_map in ["gorgona"]) exitWith { [43, 0] };
+if (_map in ["hellskitchen", "hellskitchens"]) exitWith { [32, 900] };    //Sangin summer, Sangin winter - Sangin elevation 888m (Wikipedia)
+if (_map in ["hindukush"]) exitWith { [36, 0] };
+if (_map in ["imrali", "imralispring"]) exitWith { [40, 0] };
+if (_map in ["intro"]) exitWith { [40, 0] };
+if (_map in ["isladuala3"]) exitWith { _lat = -19; _altitude = 0; };
+if (_map in ["jacobi"]) exitWith { [34, 2000] };    //default elevationOffset
+if (_map in ["kapaulio"]) exitWith { [0, 0] };
+if (_map in ["kerama"]) exitWith { [26, 0] };    //Kerama Islands, Japan - default elevationOffset
+if (_map in ["kholm"]) exitWith { [36, 0] };
+if (_map in ["koplic"]) exitWith { [42, 0] };
+if (_map in ["kunduz"]) exitWith { [37, 0] };
+if (_map in ["lingor", "lingor3"]) exitWith { _lat = -4; _altitude = 0; };
+if (_map in ["lost", "lostw"]) exitWith { [60, 0] };
+if (_map in ["mcn_aliabad"]) exitWith { [36, 0] };
+if (_map in ["malvinas"]) exitWith { _lat = -52; _altitude = 0; };
+if (_map in ["namalsk"]) exitWith { [65, 0] };
+if (_map in ["mef_alaska"]) exitWith { [60, 5] };
+if (_map in ["mountains_acr"]) exitWith { [35, 2000] };
+if (_map in ["napf", "napfwinter"]) exitWith { [47, 0] };
+if (_map in ["panthera3"]) exitWith { [46, 0] };
+if (_map in ["pianosa_aut"]) exitWith { [43, 0] };    //Pianosa, Italy - default elevationOffset
+if (_map in ["pja305"]) exitWith { [0, 0] };    //G.O.S N'Ziwasogo
+if (_map in ["pja306"]) exitWith { [35, 0] };    //G.O.S Kalu Khan
+if (_map in ["pja307"]) exitWith { [17, 0] };    //F.S.F Daryah
+if (_map in ["pja308"]) exitWith { [36, 0] };    //G.O.S Gunkizli
+if (_map in ["pja310"]) exitWith { [36, 0] };    //G.O.S Al Rayak
+if (_map in ["pja312"]) exitWith { [16, 0] };    //G.O.S Song Bin Tanh
+if (_map in ["porquerolles"]) exitWith { [43, 0] };
+if (_map in ["porto"]) exitWith { [40, 0] };
+if (_map in ["provinggrounds_pmc"]) exitWith { [35, 100] };
+if (_map in ["reshmaan"]) exitWith { [35, 2000] };
+if (_map in ["sara", "sara_dbe1"]) exitWith { [40, 0] };
+if (_map in ["saralite"]) exitWith { [40, 0] };
+if (_map in ["sb3"]) exitWith { [53, 25] };    //TrpUebPl Einfelde Nord (Munster North Training Area, Germany) - default elevationOffset
+if (_map in ["shapur_baf"]) exitWith { [35, 100] };
+if (_map in ["sfp_sturko"]) exitWith { [56, 0] };
+if (_map in ["sfp_wamako"]) exitWith { [14, 0] };
+if (_map in ["sugarlake"]) exitWith { [29, 0] };
+if (_map in ["takistan"]) exitWith { [35, 2000] };
+if (_map in ["thirsk"]) exitWith { [65, 0] };
+if (_map in ["tilos"]) exitWith { [36, 0] };
+if (_map in ["utes"]) exitWith { [50, 0] };
+if (_map in ["vt5"]) exitWith { [61, 100] };    //Vt5, Suomi Finland - default elevationOffset
+if (_map in ["wake"]) exitWith { [19, 0] };
+if (_map in ["waziristan"]) exitWith { [33, 0] };
+if (_map in ["wintermap"]) exitWith { [61, 0] };    //Nordkvingo - default elevationOffset
+if (_map in ["wintertown", "wintertowna3"]) exitWith { [39, 600] };    //U.S. state Kansas mean elevation 610m (Wikipedia)
+if (_map in ["woodland_acr"]) exitWith { [50, 0] };
+if (_map in ["xcam_prototype"]) exitWith { [35, 0] };
+if (_map in ["zargabad"]) exitWith { [35, 2000] };
 
 [] //Return empty array if we have no specific data for the map

From 950cdb1ee3d169d89ab65dbcfa0d156bfbd4ad6a Mon Sep 17 00:00:00 2001
From: bux578 <github@jonathandavid.de>
Date: Sat, 11 Jun 2016 22:05:44 +0200
Subject: [PATCH 5/5] fix missing values

was using an incomplete regex
---
 addons/common/functions/fnc_getMapData.sqf | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/addons/common/functions/fnc_getMapData.sqf b/addons/common/functions/fnc_getMapData.sqf
index f52e6dbdc7..5a621a8dfc 100644
--- a/addons/common/functions/fnc_getMapData.sqf
+++ b/addons/common/functions/fnc_getMapData.sqf
@@ -27,7 +27,7 @@ if (_map in ["abramia"]) exitWith { [60, 0] };
 if (_map in ["af_kandahar_province"]) exitWith { [42, 0] };
 if (_map in ["angel"]) exitWith { [38, 0] };
 if (_map in ["anim_helvantis_v2"]) exitWith { [50, 0] };
-if (_map in ["australia"]) exitWith { _lat = -25; _altitude = 0; };
+if (_map in ["australia"]) exitWith { [-25, 0] };
 if (_map in ["bootcamp_acr"]) exitWith { [50, 0] };
 if (_map in ["bornholm"]) exitWith { [55, 0] };
 if (_map in ["bozcaada"]) exitWith { [40, 0] };
@@ -48,17 +48,17 @@ if (_map in ["hellskitchen", "hellskitchens"]) exitWith { [32, 900] };    //Sang
 if (_map in ["hindukush"]) exitWith { [36, 0] };
 if (_map in ["imrali", "imralispring"]) exitWith { [40, 0] };
 if (_map in ["intro"]) exitWith { [40, 0] };
-if (_map in ["isladuala3"]) exitWith { _lat = -19; _altitude = 0; };
+if (_map in ["isladuala3"]) exitWith { [-19, 0] };
 if (_map in ["jacobi"]) exitWith { [34, 2000] };    //default elevationOffset
 if (_map in ["kapaulio"]) exitWith { [0, 0] };
 if (_map in ["kerama"]) exitWith { [26, 0] };    //Kerama Islands, Japan - default elevationOffset
 if (_map in ["kholm"]) exitWith { [36, 0] };
 if (_map in ["koplic"]) exitWith { [42, 0] };
 if (_map in ["kunduz"]) exitWith { [37, 0] };
-if (_map in ["lingor", "lingor3"]) exitWith { _lat = -4; _altitude = 0; };
+if (_map in ["lingor", "lingor3"]) exitWith { [-4, 0] };
 if (_map in ["lost", "lostw"]) exitWith { [60, 0] };
 if (_map in ["mcn_aliabad"]) exitWith { [36, 0] };
-if (_map in ["malvinas"]) exitWith { _lat = -52; _altitude = 0; };
+if (_map in ["malvinas"]) exitWith { [-52, 0] };
 if (_map in ["namalsk"]) exitWith { [65, 0] };
 if (_map in ["mef_alaska"]) exitWith { [60, 5] };
 if (_map in ["mountains_acr"]) exitWith { [35, 2000] };