* print available games on wrong -game and -format args

This commit is contained in:
Garux 2021-03-08 13:31:25 +03:00
parent 293fab0ffb
commit ac1dd904f1
3 changed files with 11 additions and 7 deletions

View File

@ -406,6 +406,12 @@ void HelpCommon()
}
void HelpGames(){
Sys_Printf( "Available games:\n" );
for( game_t *game = games; game->arg != NULL; ++game )
Sys_Printf( " %s\n", game->arg );
}
void HelpMain(const char* arg)
{
printf("Usage: q3map2 [stage] [common options...] [stage options...] [stage source file]\n");
@ -455,9 +461,7 @@ void HelpMain(const char* arg)
return;
}
if( striEqual( arg, "game" ) ){
printf( "Available games:\n" );
for( game_t *game = games; game->arg != NULL; ++game )
printf( " %s\n", game->arg );
HelpGames();
return;
}
}

View File

@ -196,9 +196,6 @@ void LokiInitPaths( char *argv0 ){
*/
game_t *GetGame( char *arg ){
int i;
/* dummy check */
if ( strEmptyOrNull( arg ) ) {
return NULL;
@ -217,7 +214,7 @@ game_t *GetGame( char *arg ){
}
/* test it */
i = 0;
int i = 0;
while ( games[ i ].arg != NULL )
{
if ( striEqual( arg, games[ i ].arg ) ) {
@ -227,6 +224,8 @@ game_t *GetGame( char *arg ){
}
/* no matching game */
Sys_Warning( "Game \"%s\" is unknown.\n", arg );
HelpGames();
return NULL;
}

View File

@ -1524,6 +1524,7 @@ inline float Random( void ){ /* returns a pseudorandom number between 0 and 1 */
/* help.c */
void HelpMain(const char* arg);
void HelpGames();
/* path_init.c */
game_t *GetGame( char *arg );