Created
May 22, 2023 22:39
-
-
Save nbness2/8512734d8a01631698d65294567212ec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun <I: Item> ItemContainer<I>.nbxShiftModified() { | |
var item: I | |
val slotsToShift = firstEmptySlot .. secondEmptySlot | |
for (slot in slotsToShift) { | |
item = items[slot] | |
if (slot == slotsToShift.first) continue | |
items[slot-1] = item | |
if (item.isInvalidItem()) { | |
secondEmptySlot-- | |
return | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment