From 4f73ead80c0b41a114ae0fb932e7622b5f4a48db Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 11 Jun 2016 14:32:36 -0500 Subject: [PATCH] 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