Fix quickmove in exosuit inventory

This commit is contained in:
DBotThePony 2022-09-06 22:02:16 +07:00
parent 3fdc32622d
commit d47fc7af41
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -108,11 +108,11 @@ class ExoSuitInventoryMenu(val capability: MatteryPlayerCapability) : MatteryMen
if (slotIndex == craftingResultSlot.index) {
val item = craftingResultSlot.item
val leftover = moveItemStackToSlots(item, playerCombinedInventorySlots, simulate = true)
val leftover = moveItemStackToSlots(item, playerInventorySlots, simulate = true)
if (leftover.isEmpty) {
val copy = item.copy()
moveItemStackToSlots(item, playerCombinedInventorySlots, simulate = false)
moveItemStackToSlots(item, playerInventorySlots, simulate = false)
item.count = 0
craftingResultSlot.onTake(ply, copy)
return copy
@ -124,11 +124,16 @@ class ExoSuitInventoryMenu(val capability: MatteryPlayerCapability) : MatteryMen
val copy = item.copy()
moveItemStackTo(item, playerHotbarSlots)
return copy
} else if (playerHotbarSlots.any { it.index == slotIndex } || craftingSlots.any { it.index == slotIndex }) {
} else if (playerHotbarSlots.any { it.index == slotIndex }) {
val item = slots[slotIndex].item
val copy = item.copy()
moveItemStackTo(item, playerCombinedInventorySlots)
return copy
} else if (craftingSlots.any { it.index == slotIndex }) {
val item = slots[slotIndex].item
val copy = item.copy()
moveItemStackTo(item, playerInventorySlots)
return copy
}
return ItemStack.EMPTY