chunk mesher: only remove from meshing queue if meshed

If it was interrupted it might not restart the meshing. That probably solves the "sometimes missing chunk" bug.
This commit is contained in:
Moritz Zwerger 2025-03-02 20:58:43 +01:00
parent f0db36c80b
commit dd9aee9c21
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4

View File

@ -68,11 +68,11 @@ class ChunkMesher(
fun tryMesh(item: WorldQueueItem, task: MeshPrepareTask, runnable: InterruptableRunnable) {
try {
mesh(item, runnable)
renderer.meshingQueue.tasks -= task
} catch (ignored: InterruptedException) {
} finally {
task.runnable.interruptable = false
if (Thread.interrupted()) throw InterruptedException()
renderer.meshingQueue.tasks -= task
Thread.interrupted() // clear interrupted flag
renderer.meshingQueue.work()
}
}