From df90ef562c835e2b062bc67afe46bbeb0bc9034e Mon Sep 17 00:00:00 2001
From: MaxED <j.maxed@gmail.com>
Date: Wed, 2 Sep 2015 11:28:44 +0000
Subject: [PATCH] Fixed, Thing info panel: fixed KeyNotFoundException when
 highlighted thing had unknown action. Fixed: in some cases the number of
 generalized sector effects displayed in Sector info panel and action selector
 control was calculated incorrectly.

---
 Source/Core/Config/GameConfiguration.cs | 1 +
 Source/Core/Controls/ThingInfoPanel.cs  | 9 +++++----
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/Source/Core/Config/GameConfiguration.cs b/Source/Core/Config/GameConfiguration.cs
index 315907f24..0bb08b1ce 100644
--- a/Source/Core/Config/GameConfiguration.cs
+++ b/Source/Core/Config/GameConfiguration.cs
@@ -964,6 +964,7 @@ namespace CodeImp.DoomBuilder.Config
 					{
 						title = option.Name + ": " + bit.Title;
 						matches++;
+						break;
 					}
 				}
 			}
diff --git a/Source/Core/Controls/ThingInfoPanel.cs b/Source/Core/Controls/ThingInfoPanel.cs
index 5624e553c..dc5d80f26 100644
--- a/Source/Core/Controls/ThingInfoPanel.cs
+++ b/Source/Core/Controls/ThingInfoPanel.cs
@@ -79,10 +79,11 @@ namespace CodeImp.DoomBuilder.Controls
 			ThingTypeInfo ti = General.Map.Data.GetThingInfo(t.Type);
 
 			// Get thing action information
-			LinedefActionInfo act = General.Map.Config.LinedefActions[t.Action];
-			if(General.Map.Config.LinedefActions.ContainsKey(t.Action)) actioninfo = act.ToString();
-			else if(t.Action == 0) actioninfo = t.Action + " - None";
-			else actioninfo = t.Action + " - Unknown";
+			LinedefActionInfo act;
+			if(General.Map.Config.LinedefActions.ContainsKey(t.Action)) act = General.Map.Config.LinedefActions[t.Action];
+			else if(t.Action == 0) act = new LinedefActionInfo(0, "None", true, false);
+			else act = new LinedefActionInfo(t.Action, "Unknown", false, false);
+			actioninfo = act.ToString();
 			
 			// Determine z info to show
 			t.DetermineSector();
-- 
GitLab