From 7a1a4b73723dbaecc09db55c163e4b0609979efe Mon Sep 17 00:00:00 2001 From: Valmo Trindade Date: Sun, 24 May 2026 02:58:32 -0300 Subject: [PATCH] Fixed leak global vars from convert client pos and extract role functions --- addons/client/functions/fnc_convertClientLocation.sqf | 10 +++++++--- addons/main/functions/extract_data/fn_extract_role.sqf | 10 +++++----- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/addons/client/functions/fnc_convertClientLocation.sqf b/addons/client/functions/fnc_convertClientLocation.sqf index af51c72..8122480 100644 --- a/addons/client/functions/fnc_convertClientLocation.sqf +++ b/addons/client/functions/fnc_convertClientLocation.sqf @@ -19,11 +19,15 @@ * Public: Yes */ -params["_latitude", "_longitude", "_altitude"]; +params [ + ["_latitude", 0, [0]], + ["_longitude", 0, [0]], + ["_altitude", 0, [0]] +]; -_position = [_latitude, _longitude, _altitude]; +private _position = [_latitude, _longitude, _altitude]; -_realLocation = null; +private _realLocation = [0, 0, _altitude]; switch (toLower worldName) do { case "altis": { diff --git a/addons/main/functions/extract_data/fn_extract_role.sqf b/addons/main/functions/extract_data/fn_extract_role.sqf index 423a6d7..92ea444 100644 --- a/addons/main/functions/extract_data/fn_extract_role.sqf +++ b/addons/main/functions/extract_data/fn_extract_role.sqf @@ -27,7 +27,7 @@ switch (str _side) do { }; }; -_unit_type = _unit call BIS_fnc_objectType; +private _unit_type = _unit call BIS_fnc_objectType; if ((_unit_type select 0) == "Soldier") then { switch (_unit_type select 1) do { @@ -71,7 +71,7 @@ if ((_unit_type select 0) == "Soldier") then { }; if ((typeOf (vehicle _unit) != typeOf _unit) or ((_unit_type select 0) == "Vehicle")) then { - _vehicle_type = (vehicle _unit) call BIS_fnc_objectType select 1; + private _vehicle_type = (vehicle _unit) call BIS_fnc_objectType select 1; switch (_vehicle_type) do { case "Car": { _type = "G-U-C-I-M"; @@ -111,10 +111,10 @@ if ((typeOf (vehicle _unit) != typeOf _unit) or ((_unit_type select 0) == "Vehic _role = "a-" + _affiliation + "-" + _type; -armatak_attribute_marker_type = _unit getVariable "armatak_attribute_marker_type"; +private _markerTypeOverride = _unit getVariable ["armatak_attribute_marker_type", ""]; -if (!isNil "armatak_attribute_marker_type" or armatak_attribute_marker_type != '') then { - _role = armatak_attribute_marker_type; +if (_markerTypeOverride isNotEqualTo "") then { + _role = _markerTypeOverride; }; _role