Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
  • Loading branch information
PabstMirror and johnb432 authored Aug 27, 2024
1 parent db969b3 commit 88ba4d4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
9 changes: 1 addition & 8 deletions addons/ui/fnc_getInventoryItemData.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,7 @@ switch _containerType do {
};
};

// Reports classname, but only for magazines.
// Reports classname for every item type except backpacks (https://feedback.bistudio.com/T183096)
private _classname = _control lbData _index;
if (_classname isEqualTo "") then {
// For weapons, items and glasses, use the lb index and compare with cargo item list.
private _cargoItems = weaponCargo _container + itemCargo _container + magazineCargo _container;
_cargoItems = _cargoItems arrayIntersect _cargoItems;

_classname = _cargoItems param [_index, ""];
};

[_classname, _container, _containerType]
2 changes: 2 additions & 0 deletions addons/ui/fnc_renameInventoryItem.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,5 @@ if (isNull _config) exitWith { ERROR_1("Class [%1] does not exists",_class) };
_class = configName _config; // Ensure class name is in config case

GVAR(renamedItems) set [_class, [_name, _picture]];

nil

0 comments on commit 88ba4d4

Please sign in to comment.