From 45515df7904621c053f4fca194579abe0014a5cb Mon Sep 17 00:00:00 2001 From: STJrInuyasha Date: Sat, 13 Jun 2015 15:56:28 -0700 Subject: [PATCH] Make sure "word" in readlevelheader gets reset ... because some things (Lua. custom header entries) move it. https://mb.srb2.org/showthread.php?t=40580 (Technically breaks netgame compatibility for Lua-heavy mods, so in next.) --- src/dehacked.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/dehacked.c b/src/dehacked.c index 513079e6e..6013290ef 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -998,7 +998,7 @@ static const struct { static void readlevelheader(MYFILE *f, INT32 num) { char *s = Z_Malloc(MAXLINELEN, PU_STATIC, NULL); - char *word = s; + char *word; char *word2; //char *word3; // Non-uppercase version of word2 char *tmp; @@ -1027,6 +1027,9 @@ static void readlevelheader(MYFILE *f, INT32 num) if (s == tmp) continue; // Skip comment lines, but don't break. + // Set / reset word, because some things (Lua.) move it + word = s; + // Get the part before the " = " tmp = strchr(s, '='); *(tmp-1) = '\0';