- fixed: Option value sets for the menu may not be redefined. An attempt to do so must produce a fatal error.

SVN r3671 (trunk)
This commit is contained in:
Christoph Oelckers 2012-05-31 08:47:55 +00:00
parent 3bd45f8011
commit e28ecdda50

View file

@ -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;
}