From e28ecdda50c65378cf388e42312d84d0960c5364 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 31 May 2012 08:47:55 +0000 Subject: [PATCH] - fixed: Option value sets for the menu may not be redefined. An attempt to do so must produce a fatal error. SVN r3671 (trunk) --- src/menu/menudef.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/menu/menudef.cpp b/src/menu/menudef.cpp index 79e72159a..7e5509365 100644 --- a/src/menu/menudef.cpp +++ b/src/menu/menudef.cpp @@ -507,7 +507,10 @@ static void ParseOptionValue(FScanner &sc) pair.Text = strbin1(sc.String); } FOptionValues **pOld = OptionValues.CheckKey(optname); - if (pOld != NULL && *pOld != NULL) delete *pOld; + if (pOld != NULL && *pOld != NULL) + { + sc.ScriptError("Redefinition of option value set '%s'", optname.GetChars()) + } OptionValues[optname] = val; } @@ -537,7 +540,10 @@ static void ParseOptionString(FScanner &sc) pair.Text = strbin1(sc.String); } FOptionValues **pOld = OptionValues.CheckKey(optname); - if (pOld != NULL && *pOld != NULL) delete *pOld; + if (pOld != NULL && *pOld != NULL) + { + sc.ScriptError("Redefinition of option value set '%s'", optname.GetChars()) + } OptionValues[optname] = val; }