From 5e330496ad940d56b48b6af94559b0946fc25b1a Mon Sep 17 00:00:00 2001 From: spherallic Date: Fri, 22 Dec 2023 11:42:28 +0100 Subject: [PATCH] Fix small error in light/fade alpha and fade end field handling --- Source/Core/Windows/SectorEditFormSRB2.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Core/Windows/SectorEditFormSRB2.cs b/Source/Core/Windows/SectorEditFormSRB2.cs index 8fde7211..e0f160a5 100644 --- a/Source/Core/Windows/SectorEditFormSRB2.cs +++ b/Source/Core/Windows/SectorEditFormSRB2.cs @@ -753,16 +753,16 @@ namespace CodeImp.DoomBuilder.Windows UniFields.SetString(s.Fields, "triggerer", triggerer.Text, TRIGGERER_DEFAULT); if (!string.IsNullOrEmpty(lightAlpha.Text)) - UniFields.SetInteger(s.Fields, "lightalpha", lightAlpha.GetResult(s.Fields.GetValue("lightalpha", General.Map.Config.MaxColormapAlpha)), 0); + UniFields.SetInteger(s.Fields, "lightalpha", lightAlpha.GetResult(s.Fields.GetValue("lightalpha", General.Map.Config.MaxColormapAlpha)), General.Map.Config.MaxColormapAlpha); if (!string.IsNullOrEmpty(fadeAlpha.Text)) - UniFields.SetInteger(s.Fields, "fadealpha", fadeAlpha.GetResult(s.Fields.GetValue("fadealpha", General.Map.Config.MaxColormapAlpha)), 0); + UniFields.SetInteger(s.Fields, "fadealpha", fadeAlpha.GetResult(s.Fields.GetValue("fadealpha", General.Map.Config.MaxColormapAlpha)), General.Map.Config.MaxColormapAlpha); if (!string.IsNullOrEmpty(fadeStart.Text)) UniFields.SetInteger(s.Fields, "fadestart", fadeStart.GetResult(s.Fields.GetValue("fadestart", 0)), 0); if (!string.IsNullOrEmpty(fadeEnd.Text)) - UniFields.SetInteger(s.Fields, "fadeend", fadeEnd.GetResult(s.Fields.GetValue("fadeend", General.Map.Config.NumBrightnessLevels - 1)), 0); + UniFields.SetInteger(s.Fields, "fadeend", fadeEnd.GetResult(s.Fields.GetValue("fadeend", General.Map.Config.NumBrightnessLevels - 1)), General.Map.Config.NumBrightnessLevels - 1); // Clear horizontal slopes double diff = Math.Abs(Math.Round(s.FloorSlopeOffset) - s.FloorSlopeOffset);