From 0fa960c868e86b42d1ef79e7c588988c30fc5d83 Mon Sep 17 00:00:00 2001 From: spherallic Date: Mon, 29 Jul 2024 12:25:53 +0200 Subject: [PATCH] Prevent crash when getting a new tag if a regular tag number is also used as a trigger tag --- Source/Core/Map/MapSet.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/Core/Map/MapSet.cs b/Source/Core/Map/MapSet.cs index 8b1a9773..5cb07cfc 100755 --- a/Source/Core/Map/MapSet.cs +++ b/Source/Core/Map/MapSet.cs @@ -31,6 +31,8 @@ using CodeImp.DoomBuilder.Types; using CodeImp.DoomBuilder.Windows; using CodeImp.DoomBuilder.VisualModes; using System.Diagnostics; +using static System.Windows.Forms.VisualStyles.VisualStyleElement; + #endregion @@ -3840,7 +3842,8 @@ namespace CodeImp.DoomBuilder.Map } // SRB2 also has separate trigger tag field int triggertag = sectors[i].Fields.GetValue("triggertag", 0); - if (triggertag > 0) usedtags.Add(triggertag, false); + if (triggertag == 0) continue; + if (!usedtags.ContainsKey(triggertag)) usedtags.Add(triggertag, false); } break; }