diff --git a/addons/markers/functions/fnc_onLBSelChangedColor.sqf b/addons/markers/functions/fnc_onLBSelChangedColor.sqf index 0aa541f5a5..a79495d442 100644 --- a/addons/markers/functions/fnc_onLBSelChangedColor.sqf +++ b/addons/markers/functions/fnc_onLBSelChangedColor.sqf @@ -20,4 +20,4 @@ _color = getArray (_config >> "color"); ((ctrlParent _ctrl) displayCtrl 102) ctrlSetTextColor _color; -GVAR(currentMarkerColor) = _data; +GVAR(currentMarkerColorConfigName) = (configName _config); diff --git a/addons/markers/functions/fnc_onLBSelChangedShape.sqf b/addons/markers/functions/fnc_onLBSelChangedShape.sqf index f77e1f8ff8..57caba8680 100644 --- a/addons/markers/functions/fnc_onLBSelChangedShape.sqf +++ b/addons/markers/functions/fnc_onLBSelChangedShape.sqf @@ -14,4 +14,4 @@ _icon = getText (_config >> "icon"); ((ctrlParent _ctrl) displayCtrl 102) ctrlSetText _icon; -GVAR(currentMarkerShape) = _data; +GVAR(currentMarkerConfigName) = (configName _config); diff --git a/addons/markers/functions/fnc_placeMarker.sqf b/addons/markers/functions/fnc_placeMarker.sqf index 56fe16700a..124e797e31 100644 --- a/addons/markers/functions/fnc_placeMarker.sqf +++ b/addons/markers/functions/fnc_placeMarker.sqf @@ -32,8 +32,8 @@ if (_this select 1 == 1) then { [QGVAR(setMarkerNetwork), [ allMapMarkers select (count allMapMarkers - 1), [ - GETGVAR(currentMarkerShape,0), - GETGVAR(currentMarkerColor,0), + GETGVAR(currentMarkerConfigName,""), + GETGVAR(currentMarkerColorConfigName,""), _this, GETGVAR(currentMarkerAngle,0) ] diff --git a/addons/markers/functions/fnc_setMarkerJIP.sqf b/addons/markers/functions/fnc_setMarkerJIP.sqf index 8466e35776..74bd4f97f7 100644 --- a/addons/markers/functions/fnc_setMarkerJIP.sqf +++ b/addons/markers/functions/fnc_setMarkerJIP.sqf @@ -8,20 +8,28 @@ _allMapMarkersProperties = _this select 1; _logic = _this select 2; { - _index = _allMapMarkers find _x; + _index = _allMapMarkers find _x; - if (_index != -1) then { - _data = _allMapMarkersProperties select _index; + if (_index != -1) then { + _data = _allMapMarkersProperties select _index; - _config = (configfile >> "CfgMarkers") select (_data select 0); - _x setMarkerTypeLocal configName _config; - - _config = (configfile >> "CfgMarkerColors") select (_data select 1); - _x setMarkerColorLocal configName _config; - - _x setMarkerPosLocal (_data select 2); - _x setMarkerDirLocal (_data select 3); + _config = (configfile >> "CfgMarkers") >> (_data select 0); + if (!isClass _config) then { + WARNING("CfgMarker not found, changed to milDot"); + _config == (configFile >> "CfgMarkers" >> "MilDot"); }; + _x setMarkerTypeLocal (configName _config); + + _config = (configfile >> "CfgMarkerColors") >> (_data select 1); + if (!isClass _config) then { + WARNING("CfgMarkerColors not found, changed to Default"); + _config == (configFile >> "CfgMarkerColors" >> "Default"); + }; + _x setMarkerColorLocal (configName _config); + + _x setMarkerPosLocal (_data select 2); + _x setMarkerDirLocal (_data select 3); + }; } forEach allMapMarkers; deleteVehicle _logic; diff --git a/addons/markers/functions/fnc_setMarkerNetwork.sqf b/addons/markers/functions/fnc_setMarkerNetwork.sqf index 2356574ae3..194d169f24 100644 --- a/addons/markers/functions/fnc_setMarkerNetwork.sqf +++ b/addons/markers/functions/fnc_setMarkerNetwork.sqf @@ -6,10 +6,18 @@ private ["_marker", "_data", "_config"]; _marker = _this select 0; _data = _this select 1; -_config = (configfile >> "CfgMarkers") select (_data select 0); -_marker setMarkerTypeLocal configName _config; +_config = (configfile >> "CfgMarkers") >> (_data select 0); +if (!isClass _config) then { + WARNING("CfgMarker not found, changed to milDot"); + _config == (configFile >> "CfgMarkers" >> "MilDot"); +}; +_marker setMarkerTypeLocal (configName _config); -_config = (configfile >> "CfgMarkerColors") select (_data select 1); +_config = (configfile >> "CfgMarkerColors") >> (_data select 1); +if (!isClass _config) then { + WARNING("CfgMarkerColors not found, changed to Default"); + _config == (configFile >> "CfgMarkerColors" >> "Default"); +}; _marker setMarkerColorLocal configName _config; _marker setMarkerPosLocal (_data select 2); @@ -17,21 +25,21 @@ _marker setMarkerDirLocal (_data select 3); // save properties on server machine for JIP, marker editing ready if (isMultiplayer && {isServer}) then { - private ["_allMapMarkers", "_allMapMarkersProperties", "_index"]; + private ["_allMapMarkers", "_allMapMarkersProperties", "_index"]; - _allMapMarkers = GETMVAR(allMapMarkers,[]); - _allMapMarkersProperties = GETMVAR(allMapMarkersProperties,[]); + _allMapMarkers = GETMVAR(allMapMarkers,[]); + _allMapMarkersProperties = GETMVAR(allMapMarkersProperties,[]); - _index = _allMapMarkers find _marker; + _index = _allMapMarkers find _marker; - if (_index == -1) then { - _allMapMarkers pushBack _marker; - _allMapMarkersProperties pushBack _data; - } else { - _allMapMarkers set [_index, _marker]; - _allMapMarkersProperties set [_index, _data]; - }; + if (_index == -1) then { + _allMapMarkers pushBack _marker; + _allMapMarkersProperties pushBack _data; + } else { + _allMapMarkers set [_index, _marker]; + _allMapMarkersProperties set [_index, _data]; + }; - GVAR(allMapMarkers) = _allMapMarkers; - GVAR(allMapMarkersProperties) = _allMapMarkersProperties; + GVAR(allMapMarkers) = _allMapMarkers; + GVAR(allMapMarkersProperties) = _allMapMarkersProperties; };