From b3f8a0bf04503036b5fbfd67515afab7c2d6b9c7 Mon Sep 17 00:00:00 2001 From: Dedmen Miller Date: Sun, 14 Jul 2024 15:00:57 +0200 Subject: [PATCH] Name GPS tracker by ACE cargo customName if availalbe --- .../addons/main/functions/GPS/fnc_activateTracker.sqf | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ArmaScript/addons/main/functions/GPS/fnc_activateTracker.sqf b/src/ArmaScript/addons/main/functions/GPS/fnc_activateTracker.sqf index 6f4ab7f..a52e79d 100644 --- a/src/ArmaScript/addons/main/functions/GPS/fnc_activateTracker.sqf +++ b/src/ArmaScript/addons/main/functions/GPS/fnc_activateTracker.sqf @@ -25,9 +25,11 @@ if (!isServer) exitWith { if (_trackerName == "") then { private _attachedTo = attachedTo _explosive; if (!isNull _attachedTo) then { - _trackerName = format["GPS %1-%2", if (isPlayer _attachedTo) then {name _attachedTo} else {getText (configOf _attachedTo >> "displayName")}, GVAR(TrackerCounter)]; + private _displayName = if (isPlayer _attachedTo) then {name _attachedTo} else {getText (configOf _attachedTo >> "displayName")}; + _displayName = _attachedTo getVariable ["ace_cargo_customName", _displayName]; // If this object (really only boxes) has a custom name, use that + _trackerName = format["GPS %1-%2", _displayName, GVAR(TrackerCounter)]; } else { - _trackerName = format["GPS %1-%2", name player, GVAR(TrackerCounter)]; + _trackerName = format["GPS %1-%2", name player, GVAR(TrackerCounter)]; }; GVAR(TrackerCounter) = GVAR(TrackerCounter) + 1; };