Skip to content

Commit 3ee869e

Browse files
committed
Fix ACRE radio ID capture casing
1 parent c449b8a commit 3ee869e

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

addons/main/functions/fnc_acreCaptureRadioStatesFromLoadout.sqf

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,16 @@ private _classnames = [];
4040

4141
// Radios are represented by their ID classnames; capture only those present in this cargo loadout.
4242
private _radioIds = [];
43+
private _unitRadiosLc = _unitRadios apply {toLower _x};
4344
{
44-
if (_x in _unitRadios) then {
45-
_radioIds pushBackUnique _x;
46-
};
45+
// Loadout/cargo can contain ID classnames with different casing than ACRE returns (e.g. "ACRE_PRC343_ID_3"
46+
// vs "acre_prc343_id_3"), so match case-insensitively but store the actual carried ID string.
47+
private _idx = _unitRadiosLc find (toLower _x);
48+
if (_idx >= 0) then {_radioIds pushBackUnique (_unitRadios select _idx);};
4749
} forEach _classnames;
4850

4951
if (_debug) then {
50-
diag_log text format ["[BOCR][ACRE] capture loadout unit=%1 matchedRadioIds=%2", _unit, _radioIds];
52+
diag_log text format ["[BOCR][ACRE] capture loadout unit=%1 classnames=%2 unitRadios=%3 matchedRadioIds=%4", _unit, _classnames, _unitRadios, _radioIds];
5153
};
5254

5355
private _states = [];

0 commit comments

Comments
 (0)