mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-11 08:27:29 -04:00
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:
parent
f0db36c80b
commit
dd9aee9c21
@ -68,11 +68,11 @@ class ChunkMesher(
|
|||||||
fun tryMesh(item: WorldQueueItem, task: MeshPrepareTask, runnable: InterruptableRunnable) {
|
fun tryMesh(item: WorldQueueItem, task: MeshPrepareTask, runnable: InterruptableRunnable) {
|
||||||
try {
|
try {
|
||||||
mesh(item, runnable)
|
mesh(item, runnable)
|
||||||
|
renderer.meshingQueue.tasks -= task
|
||||||
} catch (ignored: InterruptedException) {
|
} catch (ignored: InterruptedException) {
|
||||||
} finally {
|
} finally {
|
||||||
task.runnable.interruptable = false
|
task.runnable.interruptable = false
|
||||||
if (Thread.interrupted()) throw InterruptedException()
|
Thread.interrupted() // clear interrupted flag
|
||||||
renderer.meshingQueue.tasks -= task
|
|
||||||
renderer.meshingQueue.work()
|
renderer.meshingQueue.work()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user