diff --git a/addons/client/functions/fnc_convertClientLocation.sqf b/addons/client/functions/fnc_convertClientLocation.sqf index 8f97a14..1eb60d1 100644 --- a/addons/client/functions/fnc_convertClientLocation.sqf +++ b/addons/client/functions/fnc_convertClientLocation.sqf @@ -77,6 +77,9 @@ switch (toLower worldName) do { case "tanoa": { _realLocation = _position call armatak_fnc_convert_to_tanoa; }; + case "zagor_zagorsk_reserved_forest": { + _realLocation = _position call armatak_fnc_convert_to_zagor_zagorsk_reserved_forest; + }; default { _warning = format ["ARMATAK
%1", "Unsupported Map"]; [[_warning, 1.5]] call CBA_fnc_notify; diff --git a/addons/main/functions/map/fn_convert_to_zagor_zagorsk_reserved_forest.sqf b/addons/main/functions/map/fn_convert_to_zagor_zagorsk_reserved_forest.sqf new file mode 100644 index 0000000..2d2c86e --- /dev/null +++ b/addons/main/functions/map/fn_convert_to_zagor_zagorsk_reserved_forest.sqf @@ -0,0 +1,23 @@ +params["_latitude", "_longitude", "_altitude"]; + +_playerPosition = [_latitude, _longitude, _altitude]; + +_playerLatitude = _playerPosition select 0; +_playerLongitude = _playerPosition select 1; + +_playerMaxLongitude = 20480; +_playerMaxLatitude = 20480; + +_MapMaxLongitude = 48.351216; +_MapMinLongitude = 48.097496; + +_MapMaxLatitude = 38.345389; +_MapMinLatitude = 37.956754; + +_LongitudeDifference = _MapMaxLongitude - _MapMinLongitude; +_LatitudeDifference = _MapMaxLatitude - _MapMinLatitude; + +_RealLongitude = (_playerLongitude / _playerMaxLongitude) * _LongitudeDifference + _MapMinLongitude; +_RealLatitude = (_playerLatitude / _playerMaxLatitude) * _LatitudeDifference + _MapMinLatitude; + +[_RealLongitude, _RealLatitude, _playerPosition select 2]