mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-07 16:49:07 +00:00
Update ShopAssistant.java (#91)
Fixing the issue #84 - Cannot buy runes if inventory full (have runes) It's fixed for all stackable items.
This commit is contained in:
@@ -506,7 +506,7 @@ public class ShopAssistant {
|
|||||||
// TzHaar Shops
|
// TzHaar Shops
|
||||||
if (player.myShopId == 138 || player.myShopId == 139 || player.myShopId == 58) {
|
if (player.myShopId == 138 || player.myShopId == 139 || player.myShopId == 58) {
|
||||||
if (player.playerItemsN[tokkulSlot] >= TotPrice2) {
|
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().deleteItem(6529, tokkulSlot, TotPrice2);
|
||||||
player.getItemAssistant().addItem(itemID, 1);
|
player.getItemAssistant().addItem(itemID, 1);
|
||||||
ShopHandler.ShopItemsN[player.myShopId][fromSlot] -= 1;
|
ShopHandler.ShopItemsN[player.myShopId][fromSlot] -= 1;
|
||||||
@@ -528,7 +528,7 @@ public class ShopAssistant {
|
|||||||
}
|
}
|
||||||
} else if (player.myShopId == RANGE_SHOP) {
|
} else if (player.myShopId == RANGE_SHOP) {
|
||||||
if (player.playerItemsN[rangeSlot] >= TotPrice2) {
|
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().deleteItem(1464, rangeSlot, TotPrice2);
|
||||||
player.getItemAssistant().addItem(itemID, 1);
|
player.getItemAssistant().addItem(itemID, 1);
|
||||||
ShopHandler.ShopItemsN[player.myShopId][fromSlot] -= 1;
|
ShopHandler.ShopItemsN[player.myShopId][fromSlot] -= 1;
|
||||||
@@ -549,7 +549,7 @@ public class ShopAssistant {
|
|||||||
}
|
}
|
||||||
} else if (player.myShopId == CASTLE_SHOP) {
|
} else if (player.myShopId == CASTLE_SHOP) {
|
||||||
if (player.playerItemsN[castleSlot] >= TotPrice2) {
|
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().deleteItem(4067, castleSlot, TotPrice2);
|
||||||
player.getItemAssistant().addItem(itemID, 1);
|
player.getItemAssistant().addItem(itemID, 1);
|
||||||
ShopHandler.ShopItemsN[player.myShopId][fromSlot] -= 1;
|
ShopHandler.ShopItemsN[player.myShopId][fromSlot] -= 1;
|
||||||
@@ -566,7 +566,7 @@ public class ShopAssistant {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (player.playerItemsN[Slot] >= TotPrice2) {
|
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().deleteItem(995,
|
||||||
player.getItemAssistant().getItemSlot(995),
|
player.getItemAssistant().getItemSlot(995),
|
||||||
TotPrice2);
|
TotPrice2);
|
||||||
|
|||||||
Reference in New Issue
Block a user