From f0afb47c8d9d2b9491aa29eaa25d3e6f2178eff1 Mon Sep 17 00:00:00 2001 From: Jucan Andrei Daniel Date: Wed, 17 Jun 2026 12:47:49 +0300 Subject: [PATCH] fix: properly set the sky textures, only during the day --- .../Scripts/Services/World/SkyService.cs | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/Assets/Gothic-Core/Scripts/Services/World/SkyService.cs b/Assets/Gothic-Core/Scripts/Services/World/SkyService.cs index ab19d56f0..17551b45d 100644 --- a/Assets/Gothic-Core/Scripts/Services/World/SkyService.cs +++ b/Assets/Gothic-Core/Scripts/Services/World/SkyService.cs @@ -144,21 +144,26 @@ private void UpdateStateTexAndFog() Logger.LogError(e.ToString(), LogCat.Mesh); return; } + + var fogColor = new Vector3(colorValues[0], colorValues[1], colorValues[2]); foreach (var state in _stateList) { - // all states that contain day sky layer dawn, evening and day 0 to 3 - if (state.Time < 0.35 || state.Time > 0.65) + if (!(state.Time < 0.35) || !(state.Time > 0.65)) // set new textures only for day states + { + continue; + } + + state.Layer[0].TEXName = "SKYDAY_LAYER0_A" + day % 2 + ".TGA"; + + if (!(state.Time < 0.3) || !(state.Time > 0.7)) { - state.Layer[0].TEXName = "SKYDAY_LAYER0_A" + day % 2 + ".TGA"; - // day states that contain sky cloud layer day 0 to 3 - if (state.Time < 0.3 || state.Time > 0.7) - { - state.Layer[1].TEXName = "SKYDAY_LAYER1_A" + day % 2 + ".TGA"; - state.FogColor = new Vector3(colorValues[0], colorValues[1], colorValues[2]); - state.DomeColor0 = new Vector3(colorValues[0], colorValues[1], colorValues[2]); - } + continue; } + + state.Layer[1].TEXName = "SKYDAY_LAYER1_A" + day % 2 + ".TGA"; + state.FogColor = fogColor; + state.DomeColor0 = fogColor; } }