From 14f162347e0743f56435ee8a4fe6c016c1cc7974 Mon Sep 17 00:00:00 2001 From: Gptaqbc <56596815+Gptaqbc@users.noreply.github.com> Date: Thu, 24 Oct 2019 14:30:23 -0400 Subject: [PATCH] Update ShopAssistant.java (#91) Fixing the issue #84 - Cannot buy runes if inventory full (have runes) It's fixed for all stackable items. --- .../src/redone/game/shops/ShopAssistant.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/2006Redone Server/src/redone/game/shops/ShopAssistant.java b/2006Redone Server/src/redone/game/shops/ShopAssistant.java index 190db852..60f9f073 100644 --- a/2006Redone Server/src/redone/game/shops/ShopAssistant.java +++ b/2006Redone Server/src/redone/game/shops/ShopAssistant.java @@ -506,7 +506,7 @@ public class ShopAssistant { // TzHaar Shops if (player.myShopId == 138 || player.myShopId == 139 || player.myShopId == 58) { if (player.playerItemsN[tokkulSlot] >= TotPrice2) { - if (player.getItemAssistant().freeSlots() > 0) { + if (player.getItemAssistant().freeSlots() > 0 || (player.getItemAssistant().playerHasItem(itemID) && ItemDefinitions.getDef()[itemID].isStackable)) { player.getItemAssistant().deleteItem(6529, tokkulSlot, TotPrice2); player.getItemAssistant().addItem(itemID, 1); ShopHandler.ShopItemsN[player.myShopId][fromSlot] -= 1; @@ -528,7 +528,7 @@ public class ShopAssistant { } } else if (player.myShopId == RANGE_SHOP) { if (player.playerItemsN[rangeSlot] >= TotPrice2) { - if (player.getItemAssistant().freeSlots() > 0) { + if (player.getItemAssistant().freeSlots() > 0 || (player.getItemAssistant().playerHasItem(itemID) && ItemDefinitions.getDef()[itemID].isStackable)) { player.getItemAssistant().deleteItem(1464, rangeSlot, TotPrice2); player.getItemAssistant().addItem(itemID, 1); ShopHandler.ShopItemsN[player.myShopId][fromSlot] -= 1; @@ -549,7 +549,7 @@ public class ShopAssistant { } } else if (player.myShopId == CASTLE_SHOP) { if (player.playerItemsN[castleSlot] >= TotPrice2) { - if (player.getItemAssistant().freeSlots() > 0) { + if (player.getItemAssistant().freeSlots() > 0 || (player.getItemAssistant().playerHasItem(itemID) && ItemDefinitions.getDef()[itemID].isStackable)) { player.getItemAssistant().deleteItem(4067, castleSlot, TotPrice2); player.getItemAssistant().addItem(itemID, 1); ShopHandler.ShopItemsN[player.myShopId][fromSlot] -= 1; @@ -566,7 +566,7 @@ public class ShopAssistant { } } else { if (player.playerItemsN[Slot] >= TotPrice2) { - if (player.getItemAssistant().freeSlots() > 0) { + if (player.getItemAssistant().freeSlots() > 0 || (player.getItemAssistant().playerHasItem(itemID) && ItemDefinitions.getDef()[itemID].isStackable)) { player.getItemAssistant().deleteItem(995, player.getItemAssistant().getItemSlot(995), TotPrice2);