From 4cd7a512ae46c8a605d2af4f87e661c46870dacd Mon Sep 17 00:00:00 2001 From: Melledy <121644117+Melledy@users.noreply.github.com> Date: Sat, 3 Aug 2024 23:51:03 -0700 Subject: [PATCH] Fix locking/discarding items --- .../emu/lunarcore/game/inventory/InventoryService.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/emu/lunarcore/game/inventory/InventoryService.java b/src/main/java/emu/lunarcore/game/inventory/InventoryService.java index 89ee9da48..f94801885 100644 --- a/src/main/java/emu/lunarcore/game/inventory/InventoryService.java +++ b/src/main/java/emu/lunarcore/game/inventory/InventoryService.java @@ -532,12 +532,14 @@ public void lockItems(Player player, RepeatedInt list, boolean locked) { // Lock items for (int equipId : list) { GameItem item = player.getInventory().getItemByUid(equipId); - if (item == null || !item.getExcel().isEquippable()) { + if (item == null || !item.getExcel().isEquippable() || item.isDiscarded()) { continue; } item.setLocked(locked); item.save(); + + items.add(item); } // Send packet @@ -550,15 +552,17 @@ public void discardRelics(Player player, RepeatedInt list, boolean discarded) { // List of items to update on the client List items = new ArrayList<>(); - // Lock items + // Discard items for (int equipId : list) { GameItem item = player.getInventory().getItemByUid(equipId); - if (item == null || !item.getExcel().isEquippable()) { + if (item == null || !item.getExcel().isEquippable() || item.isLocked()) { continue; } item.setDiscarded(discarded); item.save(); + + items.add(item); } // Send packet