Set last returned index to -1 when removing

This commit is contained in:
DBotThePony 2025-03-25 11:52:01 +07:00
parent ba83b89476
commit 9577e205e7
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -71,6 +71,7 @@ class BlockPosSet : MutableSet<BlockPos> {
throw NoSuchElementException()
bits[last] = false
last = -1
}
}
}
@ -157,6 +158,7 @@ class BlockPosSet : MutableSet<BlockPos> {
override fun next(): BlockPos {
findNext()
last = current
foundNext = false
val blockPos = current.next()
return blockPos
}