Skip to content

Commit

Permalink
restored GZDoom's console alias code.
Browse files Browse the repository at this point in the history
This got changed in Raze's early development when it was still using the EDuke32 console and later not changed back.
  • Loading branch information
coelckers committed Feb 4, 2024
1 parent e5d6296 commit 4b6646d
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions source/core/gameconfigfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
}
Expand Down

0 comments on commit 4b6646d

Please sign in to comment.