From 4b6646da039267d80b08cb7cde279c44b3e46756 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 4 Feb 2024 14:54:19 +0100 Subject: [PATCH] restored GZDoom's console alias code. This got changed in Raze's early development when it was still using the EDuke32 console and later not changed back. --- source/core/gameconfigfile.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/source/core/gameconfigfile.cpp b/source/core/gameconfigfile.cpp index 87fdb01834..c99c6bc01c 100644 --- a/source/core/gameconfigfile.cpp +++ b/source/core/gameconfigfile.cpp @@ -372,13 +372,21 @@ void FGameConfigFile::DoGameSetup (const char *gamename) { ReadCVars (0); } - strncpy (subsection, "ConsoleAliases", sublen); - if (SetSection (section)) + strncpy(subsection, "ConsoleAliases", sublen); + if (SetSection(section)) { - while (NextInSection (key, value)) + const char* name = NULL; + while (NextInSection(key, value)) { - FStringf cmd("alias %s \"%s\"", key, value); - C_DoCommand(cmd.GetChars()); + if (stricmp(key, "Name") == 0) + { + name = value; + } + else if (stricmp(key, "Command") == 0 && name != NULL) + { + C_SetAlias(name, value); + name = NULL; + } } } }