cloud renderer: fix error when dimension not capable of clouds

This commit is contained in:
Bixilon 2022-11-10 19:07:06 +01:00
parent 0448ce90d4
commit 18316bfa0b
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4

View File

@ -112,6 +112,9 @@ class CloudsRenderer(
} }
override fun prepareDrawAsync() { override fun prepareDrawAsync() {
if (!sky.effects.clouds) {
return
}
if (layers.size != nextLayers) { if (layers.size != nextLayers) {
updateLayers(nextLayers) updateLayers(nextLayers)
} }
@ -124,6 +127,9 @@ class CloudsRenderer(
for (unload in toUnload) { for (unload in toUnload) {
unload.unload() unload.unload()
} }
if (!sky.effects.clouds) {
return
}
for (layer in layers) { for (layer in layers) {
layer.prepare() layer.prepare()
} }