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.
This commit is contained in:
Christoph Oelckers 2024-02-04 14:54:19 +01:00
parent e5d6296581
commit 4b6646da03

View file

@ -372,13 +372,21 @@ void FGameConfigFile::DoGameSetup (const char *gamename)
{ {
ReadCVars (0); ReadCVars (0);
} }
strncpy (subsection, "ConsoleAliases", sublen); strncpy(subsection, "ConsoleAliases", sublen);
if (SetSection (section)) if (SetSection(section))
{ {
while (NextInSection (key, value)) const char* name = NULL;
while (NextInSection(key, value))
{ {
FStringf cmd("alias %s \"%s\"", key, value); if (stricmp(key, "Name") == 0)
C_DoCommand(cmd.GetChars()); {
name = value;
}
else if (stricmp(key, "Command") == 0 && name != NULL)
{
C_SetAlias(name, value);
name = NULL;
}
} }
} }
} }