From 09e40d2bae3e01db31692630a9cd1ea140a4d6ae Mon Sep 17 00:00:00 2001 From: biwa <6475593+biwa@users.noreply.github.com> Date: Fri, 23 Oct 2020 21:04:49 +0200 Subject: [PATCH] DECALDEF parser: fixed a crash when there are duplicate decal group entries in the DECALDEF files --- Source/Core/ZDoom/DecalInfo.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Source/Core/ZDoom/DecalInfo.cs b/Source/Core/ZDoom/DecalInfo.cs index df15efeb..9446e913 100644 --- a/Source/Core/ZDoom/DecalInfo.cs +++ b/Source/Core/ZDoom/DecalInfo.cs @@ -197,7 +197,15 @@ namespace CodeImp.DoomBuilder.ZDoom } // Add name of child to the list of children - childdecals.Add(token, null); + if (childdecals.ContainsKey(token)) + { + // TODO: report problem + + // Overwrite existing decal with new one (who knows if that's the correct way do handle duplicate entries?) + childdecals[token] = null; + } + else + childdecals.Add(token, null); // Read the probability wheight. We don't use it, though int weight = 0;