From b772c5c756cd583884d9c97227fae640ca3fe287 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 18 May 2024 20:12:43 -0500 Subject: [PATCH] Use `infoPanelComponents` Co-Authored-By: johnb432 <58661205+johnb432@users.noreply.github.com> --- addons/maptools/XEH_postInitClient.sqf | 1 - addons/maptools/functions/fnc_canUseMapGPS.sqf | 9 +++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/addons/maptools/XEH_postInitClient.sqf b/addons/maptools/XEH_postInitClient.sqf index 9bac9a81b52..5ce1e68892f 100644 --- a/addons/maptools/XEH_postInitClient.sqf +++ b/addons/maptools/XEH_postInitClient.sqf @@ -5,7 +5,6 @@ if (!hasInterface) exitWith {}; // Init variables -GVAR(gpsDevicesCache) = createHashMap; GVAR(mapGpsShow) = true; GVAR(mapGpsNextUpdate) = -1; diff --git a/addons/maptools/functions/fnc_canUseMapGPS.sqf b/addons/maptools/functions/fnc_canUseMapGPS.sqf index 121ae5b4d7f..e9ca813288a 100644 --- a/addons/maptools/functions/fnc_canUseMapGPS.sqf +++ b/addons/maptools/functions/fnc_canUseMapGPS.sqf @@ -17,10 +17,7 @@ if (!visibleMap || {!alive ACE_player}) exitWith {false}; -private _assignedGPS = ACE_player getSlotItemName TYPE_GPS; -if (_assignedGPS == "") exitwith { false }; +private _panels = flatten (ACE_player infoPanelComponents "left"); +private _index = _panels find "MinimapDisplayComponent"; -GVAR(gpsDevicesCache) getOrDefaultCall [_assignedGPS, { - (_assignedGPS call BIS_fnc_itemType) params ["", "_type"]; - _type in ["GPS", "UAVTerminal"] -}, true] +_index != -1 && {_panels select (_index + 1)}