diff --git a/addons/inventory/functions/fnc_forceItemListUpdate.sqf b/addons/inventory/functions/fnc_forceItemListUpdate.sqf index e478012ce6..a806326677 100644 --- a/addons/inventory/functions/fnc_forceItemListUpdate.sqf +++ b/addons/inventory/functions/fnc_forceItemListUpdate.sqf @@ -18,9 +18,8 @@ disableSerialization; params ["_display"]; -private _index = GVAR(selectedFilterIndex); private _itemList = _display call FUNC(currentItemListBox); -private _filterFunction = missionNamespace getVariable ((_display displayCtrl IDC_FILTERLISTS) lbData _index); +private _filterFunction = missionNamespace getVariable ((_display displayCtrl IDC_FILTERLISTS) lbData GVAR(selectedFilterIndex)); if (_filterFunction isEqualType {}) then { for "_i" from (lbSize _itemList) - 1 to 0 step -1 do { diff --git a/addons/inventory/functions/fnc_inventoryDisplayLoad.sqf b/addons/inventory/functions/fnc_inventoryDisplayLoad.sqf index 47e040e644..ca9f7a5343 100644 --- a/addons/inventory/functions/fnc_inventoryDisplayLoad.sqf +++ b/addons/inventory/functions/fnc_inventoryDisplayLoad.sqf @@ -25,7 +25,7 @@ private _filter = _display displayCtrl IDC_FILTERLISTS; // the first three indecies are hard coded: 0 - weapons , 1 - magazines, 2 - items // all of them show backpacks, because BI // all other indecies show everything, so all we have to do is delete stuff we dont like -_filter ctrlAddEventHandler ["LBSelChanged", {_this call FUNC(onLBSelChanged)}]; +_filter ctrlAddEventHandler ["LBSelChanged", LINKFUNC(onLBSelChanged)]; // have to add these a frame later, because this event happens before the engine adds the default filters [{ @@ -70,9 +70,5 @@ _dummyControl ctrlAddEventHandler ["Draw", { private _itemList = _display call FUNC(currentItemListBox); - // monitoring is done by setting a lb value. These are unused here and are reset every time the list box updates. - if (_itemList lbValue 0 != DUMMY_VALUE) then { - _display call FUNC(forceItemListUpdate); - _itemList lbSetValue [0, DUMMY_VALUE]; - }; + _display call FUNC(forceItemListUpdate); }];