diff --git a/apps/openmw/mwgui/inventorywindow.cpp b/apps/openmw/mwgui/inventorywindow.cpp index 4fbfc2c67..d3c6073f4 100644 --- a/apps/openmw/mwgui/inventorywindow.cpp +++ b/apps/openmw/mwgui/inventorywindow.cpp @@ -615,13 +615,14 @@ namespace MWGui void InventoryWindow::cycle(bool next) { - ItemModel::ModelIndex selected = 0; + ItemModel::ModelIndex selected = -1; // not using mSortFilterModel as we only need sorting, not filtering SortFilterItemModel model(new InventoryItemModel(MWBase::Environment::get().getWorld()->getPlayerPtr())); model.setSortByType(false); model.update(); if (model.getItemCount() == 0) return; + for (ItemModel::ModelIndex i=0; i