Fixed issue where eating/firemaking/decanting replaced item from incorrect inventory slot

Corrected potion decanting and bank pin interface sounds
This commit is contained in:
Woahscam
2023-08-28 13:08:45 +00:00
committed by Ryan
parent 1d775bd2d3
commit 93082bc94a
9 changed files with 307 additions and 317 deletions
+7 -1
View File
@@ -337,12 +337,18 @@ fun replaceSlot(player: Player, slot: Int, item: Item, currentItem: Item? = null
Container.BANK -> player.bank
}
if (item.id == -1 || item.amount <= 0) {
return cont.replace(null, slot)
}
if (currentItem == null) {
return cont.replace(item, slot)
}
if (cont.remove(currentItem))
if (cont.remove(currentItem, slot, true)) {
return cont.replace(item, slot)
}
PlayerMonitor.log(player, LogType.DUPE_ALERT, "Potential slot-replacement-based dupe attempt, slot: $slot, item: $item")
val other = when (container) {
Container.INVENTORY -> Container.EQUIPMENT