Add checks for background mode before updating night gradient and intensity

This commit is contained in:
2026-04-13 15:16:47 +02:00
parent 22dd8ac5bb
commit de48a7530e

View File

@@ -3601,6 +3601,10 @@ export function App({ store, initialStatusMessage }: AppProps) {
? "Updated the night gradient top color."
: "Updated the night gradient bottom color.",
(world) => {
if (world.timeOfDay.night.background.mode !== "verticalGradient") {
return;
}
world.timeOfDay.night.background =
edge === "top"
? {
@@ -3625,6 +3629,10 @@ export function App({ store, initialStatusMessage }: AppProps) {
"Set night background environment intensity",
"Updated the night background environment intensity.",
(world) => {
if (world.timeOfDay.night.background.mode !== "image") {
return;
}
world.timeOfDay.night.background = {
...world.timeOfDay.night.background,
environmentIntensity: readNonNegativeNumberDraft(