mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-09 16:45:44 -07:00
Fixed unnoting items failing to unnote correctly when quantity is equal to free slots
This commit is contained in:
parent
ed47883bea
commit
6e9183ea8f
1 changed files with 5 additions and 3 deletions
|
|
@ -52,9 +52,11 @@ class BankBoothListener : InteractionListener {
|
||||||
var amount = item.amount
|
var amount = item.amount
|
||||||
val freeSlotCount = freeSlots(player)
|
val freeSlotCount = freeSlots(player)
|
||||||
|
|
||||||
if (amount > freeSlotCount) {
|
// If there is exactly one more note than free slots
|
||||||
amount = freeSlotCount
|
// the note disappearing can be used as the last slot
|
||||||
}
|
if (amount > freeSlotCount && amount != freeSlotCount + 1) {
|
||||||
|
amount = freeSlotCount
|
||||||
|
}
|
||||||
|
|
||||||
if (removeItem(player, Item(item.id, amount))) {
|
if (removeItem(player, Item(item.id, amount))) {
|
||||||
addItem(player, item.noteChange, amount)
|
addItem(player, item.noteChange, amount)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue