From 5914e16076339ef487094dba8be67eed21b0a811 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sat, 18 Oct 2014 20:33:30 -0400 Subject: dehacked: Allow override of string replacements. If loading two dehacked patches and both replace the same string, the second replacement should override the first. Change the API function DEH_AddStringReplacement so that the from_text and to_text are implicitly duplicated, and we can free to_text and replace it later if we subsequently change it to something else. --- src/doom/deh_bexstr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/doom') diff --git a/src/doom/deh_bexstr.c b/src/doom/deh_bexstr.c index e29b71dc..ac3ab651 100644 --- a/src/doom/deh_bexstr.c +++ b/src/doom/deh_bexstr.c @@ -360,7 +360,7 @@ static void DEH_BEXStrParseLine(deh_context_t *context, char *line, void *tag) { if (!strcmp(bex_stringtable[i].macro, variable_name)) { - DEH_AddStringReplacement(bex_stringtable[i].string, strdup(value)); + DEH_AddStringReplacement(bex_stringtable[i].string, value); } } } -- cgit v1.2.3