From abb61f1f092ee01facb26fc4cc952f92126b9116 Mon Sep 17 00:00:00 2001
From: biwa <6475593+biwa@users.noreply.github.com>
Date: Sat, 23 May 2020 01:37:14 +0200
Subject: [PATCH] Possible fixed a crash in
 LinedefInfoPanel.SetPairedUDMFFieldsLabel

---
 Source/Core/Controls/LinedefInfoPanel.cs | 12 ++++++------
 Source/Core/Map/UniFields.cs             |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/Source/Core/Controls/LinedefInfoPanel.cs b/Source/Core/Controls/LinedefInfoPanel.cs
index 4b9cddc2c..df302b849 100755
--- a/Source/Core/Controls/LinedefInfoPanel.cs
+++ b/Source/Core/Controls/LinedefInfoPanel.cs
@@ -445,16 +445,16 @@ namespace CodeImp.DoomBuilder.Controls
 					backpanel.Text += ". Offset " + l.Back.OffsetX + ", " + l.Back.OffsetY + ". Sector " + l.Back.Sector.Index + " ";
 
 					//sidedef top
-					hasTopFields = SetPairedUDMFFieldsLabel(l.Back.Fields, "offsetx_top", "offsety_top", 0f, backTopUDMFOffsetLabel, backTopUDMFOffset, highlight);
-					hasTopFields |= SetPairedUDMFFieldsLabel(l.Back.Fields, "scalex_top", "scaley_top", 1.0f, backTopUDMFScaleLabel, backTopUDMFScale, highlight);
+					hasTopFields = SetPairedUDMFFieldsLabel(l.Back.Fields, "offsetx_top", "offsety_top", 0.0, backTopUDMFOffsetLabel, backTopUDMFOffset, highlight);
+					hasTopFields |= SetPairedUDMFFieldsLabel(l.Back.Fields, "scalex_top", "scaley_top", 1.0, backTopUDMFScaleLabel, backTopUDMFScale, highlight);
 
 					//sidedef middle
-					hasMiddleFields = SetPairedUDMFFieldsLabel(l.Back.Fields, "offsetx_mid", "offsety_mid", 0f, backMidUDMFOffsetLabel, backMidUDMFOffset, highlight);
-					hasMiddleFields |= SetPairedUDMFFieldsLabel(l.Back.Fields, "scalex_mid", "scaley_mid", 1.0f, backMidUDMFScaleLabel, backMidUDMFScale, highlight);
+					hasMiddleFields = SetPairedUDMFFieldsLabel(l.Back.Fields, "offsetx_mid", "offsety_mid", 0.0, backMidUDMFOffsetLabel, backMidUDMFOffset, highlight);
+					hasMiddleFields |= SetPairedUDMFFieldsLabel(l.Back.Fields, "scalex_mid", "scaley_mid", 1.0, backMidUDMFScaleLabel, backMidUDMFScale, highlight);
 
 					//sidedef bottom
-					hasBottomFields = SetPairedUDMFFieldsLabel(l.Back.Fields, "offsetx_bottom", "offsety_bottom", 0f, backBottomUDMFOffsetLabel, backBottomUDMFOffset, highlight);
-					hasBottomFields |= SetPairedUDMFFieldsLabel(l.Back.Fields, "scalex_bottom", "scaley_bottom", 1.0f, backBottomUDMFScaleLabel, backBottomUDMFScale, highlight);
+					hasBottomFields = SetPairedUDMFFieldsLabel(l.Back.Fields, "offsetx_bottom", "offsety_bottom", 0.0, backBottomUDMFOffsetLabel, backBottomUDMFOffset, highlight);
+					hasBottomFields |= SetPairedUDMFFieldsLabel(l.Back.Fields, "scalex_bottom", "scaley_bottom", 1.0, backBottomUDMFScaleLabel, backBottomUDMFScale, highlight);
 
 					//visibility
 					backTopUDMFOffset.Visible = hasTopFields;
diff --git a/Source/Core/Map/UniFields.cs b/Source/Core/Map/UniFields.cs
index 09994bc92..b57daed0b 100755
--- a/Source/Core/Map/UniFields.cs
+++ b/Source/Core/Map/UniFields.cs
@@ -100,7 +100,7 @@ namespace CodeImp.DoomBuilder.Map
 		#region ================== mxd. Static methods
 
 		// float
-		public static void SetFloat(UniFields fields, string key, double value) { SetFloat(fields, key, value, 0f); }
+		public static void SetFloat(UniFields fields, string key, double value) { SetFloat(fields, key, value, 0.0); }
 		public static void SetFloat(UniFields fields, string key, double value, double defaultvalue)
 		{
 			if(fields == null) return;
-- 
GitLab