Permalink
Browse files

Make sure we initialize cgame console commands only once.

  • Loading branch information...
Kangz committed Dec 8, 2015
1 parent 607ed43 commit e16819ffe0f089c5bd0b34f871ac4c27db761bb1
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/cgame/cg_consolecmds.cpp
@@ -559,9 +559,14 @@ so it can perform tab completion
*/
void CG_InitConsoleCommands()
{
unsigned i;
static bool initialized = false;

for ( i = 0; i < ARRAY_LEN( commands ); i++ )
if (initialized) {
return;
}
initialized = true;

for ( unsigned i = 0; i < ARRAY_LEN( commands ); i++ )
{
//Check that the commands are in increasing order so that it can be used by bsearch
if ( i != 0 && Q_stricmp(commands[i-1].cmd, commands[i].cmd) > 0 )

0 comments on commit e16819f

Please sign in to comment.