[GH-ISSUE #84] Cannot buy runes if inventory full (have runes) #1439

Closed
opened 2026-05-21 10:14:35 +00:00 by Dark98 · 3 comments
Owner

Originally created by @RedSparr0w on GitHub (Oct 22, 2019).
Original GitHub issue: https://github.com/2006-Scape/2006Scape/issues/84

You can't buy runes from a shop if you have no space in your inventory (but already have that rune in your inventory)

Originally created by @RedSparr0w on GitHub (Oct 22, 2019). Original GitHub issue: https://github.com/2006-Scape/2006Scape/issues/84 You can't buy runes from a shop if you have no space in your inventory (but already have that rune in your inventory)
Author
Owner

@Gptaqbc commented on GitHub (Oct 23, 2019):

There is a little fix to do in the 2006rebotted/2006Redone Server/src/redone/game/shops/ShopAssistant.java to solve this issue.

The problem is here :

if (player.getItemAssistant().freeSlots() > 0)

This should be changed to also check if the player have a stack of the items he tries to buy in his inventory.

I don't know if it's possible as I can't look at all the code as of right now but it doesn't seem really hard to check the inventory for an item at this step.

<!-- gh-comment-id:545615903 --> @Gptaqbc commented on GitHub (Oct 23, 2019): There is a little fix to do in the 2006rebotted/2006Redone Server/src/redone/game/shops/ShopAssistant.java to solve this issue. The problem is here : > if (player.getItemAssistant().freeSlots() > 0) This should be changed to also check if the player have a stack of the items he tries to buy in his inventory. I don't know if it's possible as I can't look at all the code as of right now but it doesn't seem really hard to check the inventory for an item at this step.
Author
Owner

@Gptaqbc commented on GitHub (Oct 23, 2019):

|| player.getItemAssistant().playerHasItem(itemID)

This is what needs to be added but I can seem to figure out how to know if the itemId is a stackable item. I'll be back later

Edit: got it

<!-- gh-comment-id:545660808 --> @Gptaqbc commented on GitHub (Oct 23, 2019): || player.getItemAssistant().playerHasItem(itemID) This is what needs to be added but I can seem to figure out how to know if the itemId is a stackable item. I'll be back later Edit: got it
Author
Owner

@Gptaqbc commented on GitHub (Oct 23, 2019):

It now works for stackable items! I'll just have to do some testing to be sure it's all good.

Could I be assigned to the task real quick? thx!

<!-- gh-comment-id:545662744 --> @Gptaqbc commented on GitHub (Oct 23, 2019): It now works for stackable items! I'll just have to do some testing to be sure it's all good. Could I be assigned to the task real quick? thx!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: 2006-Scape/2006Scape#1439