Added Chernarus map support with new convert function paramether, to handle rotated maps

This commit is contained in:
Valmo Trindade
2025-02-23 13:56:47 -03:00
parent 883db07797
commit 452394f995
3 changed files with 36 additions and 0 deletions

View File

@@ -64,6 +64,9 @@ class CfgFunctions {
class convert_to_takistan_montains { class convert_to_takistan_montains {
file = "\armatak\armatak\armatak_main\functions\map\fn_convert_to_takistan_montains.sqf"; file = "\armatak\armatak\armatak_main\functions\map\fn_convert_to_takistan_montains.sqf";
}; };
class convert_to_chernarus {
file = "\armatak\armatak\armatak_main\functions\map\fn_convert_to_chernarus.sqf";
};
}; };
}; };
}; };

View File

@@ -20,6 +20,9 @@ switch (toLower worldName) do {
case "cucui": { case "cucui": {
_realLocation = _position call armatak_fnc_convert_to_cucui; _realLocation = _position call armatak_fnc_convert_to_cucui;
}; };
case "chernarus": {
_realLocation = _position call armatak_fnc_convert_to_chernarus;
};
case "mountains_acr": { case "mountains_acr": {
_realLocation = _position call armatak_fnc_convert_to_takistan_montains; _realLocation = _position call armatak_fnc_convert_to_takistan_montains;
}; };

View File

@@ -0,0 +1,30 @@
params ["_longitudeInGame", "_latitudeInGame", "_altitude"];
private _mapWidth = 15360;
private _mapHeight = 15360;
// SW corner (used as origin)
private _SW_lat = 50.63894;
private _SW_lon = 14.01891;
// SE corner
private _SE_lat = 50.65766;
private _SE_lon = 14.23361;
// NW corner
private _NW_lat = 50.77697;
private _NW_lon = 13.98893;
private _edgeSE_lat = _SE_lat - _SW_lat;
private _edgeSE_lon = _SE_lon - _SW_lon;
private _edgeNW_lat = _NW_lat - _SW_lat;
private _edgeNW_lon = _NW_lon - _SW_lon;
private _fx = _longitudeInGame / _mapWidth;
private _fy = _latitudeInGame / _mapHeight;
private _realLat = _SW_lat + (_fx * _edgeSE_lat) + (_fy * _edgeNW_lat);
private _realLon = _SW_lon + (_fx * _edgeSE_lon) + (_fy * _edgeNW_lon);
[_realLat, _realLon, _altitude]