summaryrefslogtreecommitdiff
path: root/src/cgame/cg_consolecmds.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cgame/cg_consolecmds.c')
-rw-r--r--src/cgame/cg_consolecmds.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/cgame/cg_consolecmds.c b/src/cgame/cg_consolecmds.c
index 8d88c0a8..d0529c62 100644
--- a/src/cgame/cg_consolecmds.c
+++ b/src/cgame/cg_consolecmds.c
@@ -197,7 +197,7 @@ CG_ClientMenu
static void CG_ClientMenu( const char *menuname )
{
char menuDef[ MAX_STRING_CHARS ];
- int i;
+ int i, j = 0;
if( !Q_stricmp( menuname, "dinfest" ) )
{
@@ -205,13 +205,19 @@ static void CG_ClientMenu( const char *menuname )
for( i = PCL_NONE + 1; i < PCL_NUM_CLASSES; i++ )
{
if( BG_ClassCanEvolveFromTo( cg.snap->ps.stats[ STAT_PCLASS ], i ) )
+ {
strcat( menuDef, va( "%s, class %s|", BG_FindNameForClassNum( i ), BG_FindNameForClassNum( i ) ) );
+ j++;
+ }
}
strcat( menuDef, "|Choose a class|to evolve to" );
- trap_SendConsoleCommand( va( "defmenu infest \"%s\"\n", menuDef ) );
- trap_SendConsoleCommand( "menu infest\n" );
- trap_SendConsoleCommand( "undefmenu infest\n" );
+ if( j )
+ {
+ trap_SendConsoleCommand( va( "defmenu infest \"%s\"\n", menuDef ) );
+ trap_SendConsoleCommand( "menu infest\n" );
+ trap_SendConsoleCommand( "undefmenu infest\n" );
+ }
}
else if( !Q_stricmp( menuname, "hmcusell" ) )
{