Skip to content

Commit 8fe14dc

Browse files
committed
Added Clafghan Map Support
1 parent 1bec26d commit 8fe14dc

File tree

3 files changed

+45
-16
lines changed

3 files changed

+45
-16
lines changed

addons/client/functions/fnc_convertClientLocation.sqf

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
#include "..\script_component.hpp"
22

33
/*
4-
* Author: Valmo Trindade
5-
* This function is used to convert the position of a unit to the world world location.
6-
*
7-
* Argument:
8-
* 0: in game latitude <NUMBER> is the latitude of the unit.
9-
* 1: in game longitude <NUMBER> is the longitude of the unit.
10-
* 2: in game altitude <NUMBER> is the altitude of the unit.
11-
* 3: in game bearing <NUMBER> is the bearing of the unit.
12-
*
13-
* Return Value:
14-
* ARRAY -> [latitude, longitude, altitude, bearing]
15-
*
16-
* Example:
17-
* [player] call armatak_client_fnc_convertClientLocation;
18-
*
19-
* Public: Yes
4+
* Author: Valmo Trindade
5+
* This function is used to convert the position of a unit to the world world location.
6+
*
7+
* Argument:
8+
* 0: in game latitude <NUMBER> is the latitude of the unit.
9+
* 1: in game longitude <NUMBER> is the longitude of the unit.
10+
* 2: in game altitude <NUMBER> is the altitude of the unit.
11+
* 3: in game bearing <NUMBER> is the bearing of the unit.
12+
*
13+
* Return Value:
14+
* ARRAY -> [latitude, longitude, altitude, bearing]
15+
*
16+
* Example:
17+
* [player] call armatak_client_fnc_convertClientLocation;
18+
*
19+
* Public: Yes
2020
*/
2121

2222
params["_latitude", "_longitude", "_altitude"];
@@ -101,6 +101,9 @@ switch (toLower worldName) do {
101101
case "umb_colombia": {
102102
_realLocation = _position call armatak_fnc_convert_to_colombia;
103103
};
104+
case "clafghan": {
105+
_realLocation = _position call armatak_fnc_convert_to_clafghan;
106+
};
104107
default {
105108
_warning = format ["<t color='#FF8021'>ARMATAK</t><br/> %1", "Unsupported Map"];
106109
[[_warning, 1.5]] call CBA_fnc_notify;

addons/main/CfgFunctions.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ class CfgFunctions {
116116
class convert_to_colombia {
117117
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_colombia.sqf";
118118
};
119+
class convert_to_clafghan {
120+
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_clafghan.sqf";
121+
};
119122
};
120123
};
121124
};
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
params["_latitude", "_longitude", "_altitude"];
2+
3+
_playerPosition = [_latitude, _longitude, _altitude];
4+
5+
_playerLatitude = _playerPosition select 0;
6+
_playerLongitude = _playerPosition select 1;
7+
8+
_playerMaxLatitude = 20480;
9+
_playerMaxLongitude = 20480;
10+
11+
_MapMaxLatitude = 33.728772;
12+
_MapMinLatitude = 33.542815;
13+
14+
_MapMaxLongitude = 63.169746;
15+
_MapMinLongitude = 62.938820;
16+
17+
_LongitudeDifference = _MapMaxLongitude - _MapMinLongitude;
18+
_LatitudeDifference = _MapMaxLatitude - _MapMinLatitude;
19+
20+
_RealLongitude = (_playerLongitude / _playerMaxLongitude) * _LongitudeDifference + _MapMinLongitude;
21+
_RealLatitude = (_playerLatitude / _playerMaxLatitude) * _LatitudeDifference + _MapMinLatitude;
22+
23+
[_RealLongitude, _RealLatitude, _playerPosition select 2]

0 commit comments

Comments
 (0)