From 9d846231bce4f5ea1ff0f46aabb0aca8cbab0697 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 10 Nov 2026 14:12:45 -0500 Subject: [PATCH] Fix weather setup failing on missing clouds maximum percent Morrowind.ini has no Clouds_Maximum_Percent for Ashstorm or Blight, so esmfallbacks.lua passed 0 and the weather binding threw, aborting the rest of generateDefaultWeathers. Clamp to a tiny positive value, which keeps the old C++ behavior of swapping cloud textures immediately. Co-Authored-By: Claude Opus 5.5 --- files/data-mw/scripts/omw/esmfallbacks.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/files/data-mw/scripts/omw/esmfallbacks.lua b/files/data-mw/scripts/omw/esmfallbacks.lua index 717a717691..e6ecbf8475 100644 --- a/files/data-mw/scripts/omw/esmfallbacks.lua +++ b/files/data-mw/scripts/omw/esmfallbacks.lua @@ -279,7 +279,10 @@ local function generateDefaultWeathers() rainThreshold = getFloat(('Weather_%s_Rain_Threshold'):format(recordId)), rainMinHeight = getFloat(('Weather_%s_Rain_Height_Min'):format(recordId)), rainMaxHeight = getFloat(('Weather_%s_Rain_Height_Max'):format(recordId)), - cloudsMaximumPercent = getFloat(('Weather_%s_Clouds_Maximum_Percent'):format(recordId)), + -- Morrowind.ini has no value for Ashstorm or Blight. The engine + -- requires (0, 1], so a tiny value keeps the old behavior of + -- swapping cloud textures as soon as the transition starts. + cloudsMaximumPercent = math.max(getFloat(('Weather_%s_Clouds_Maximum_Percent'):format(recordId)), 1e-6), isStorm = windSpeed > fStromWindSpeed, cloudTexture = getString(('Weather_%s_Cloud_Texture'):format(recordId)), distantLandFogFactor = dlFactor,