Skip to content

Commit 7c91d1c

Browse files
committed
fix(InventoryScreen): fix inventory not updating when dropping last item row on screen
1 parent 0f02aed commit 7c91d1c

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

engine/src/main/java/org/destinationsol/ui/nui/screens/InventoryScreen.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -304,13 +304,12 @@ public void setSelected(List<SolItem> itemGroup) {
304304
ItemContainer items = inventoryOperations.getItems(solApplication.getGame());
305305
if (!items.containsGroup(itemGroup)) {
306306
selectedIndex = 0;
307-
return;
308-
}
309-
310-
for (int groupNo = 0; groupNo < items.groupCount(); groupNo++) {
311-
if (items.getGroup(groupNo) == itemGroup) {
312-
page = groupNo / Const.ITEM_GROUPS_PER_PAGE;
313-
selectedIndex = groupNo % Const.ITEM_GROUPS_PER_PAGE;
307+
} else {
308+
for (int groupNo = 0; groupNo < items.groupCount(); groupNo++) {
309+
if (items.getGroup(groupNo) == itemGroup) {
310+
page = groupNo / Const.ITEM_GROUPS_PER_PAGE;
311+
selectedIndex = groupNo % Const.ITEM_GROUPS_PER_PAGE;
312+
}
314313
}
315314
}
316315

0 commit comments

Comments
 (0)