gametype command now prints gametype NAMES instead of numbers. Even prints "Single player" when appropriate!

git-svn-id: https://code.orospakr.ca/svn/srb2/trunk@8997 6de4a73c-47e2-0310-b8c1-93d6ecd3f8cd
This commit is contained in:
MonsterIestyn 2015-01-22 17:57:26 +00:00 committed by Alam Ed Arias
parent 0dff0d84de
commit 9b0e09877e
1 changed files with 21 additions and 1 deletions

View File

@ -3193,7 +3193,27 @@ static void Command_ModDetails_f(void)
//
static void Command_ShowGametype_f(void)
{
CONS_Printf(M_GetText("Current gametype is %d\n"), gametype);
INT32 j;
const char *gametypestr = NULL;
if (!(netgame || multiplayer)) // print "Single player" instead of "Co-op"
{
CONS_Printf(M_GetText("Current gametype is %s\n"), M_GetText("Single player"));
return;
}
// find name string for current gametype
for (j = 0; gametype_cons_t[j].strvalue; j++)
{
if (gametype_cons_t[j].value == gametype)
{
gametypestr = gametype_cons_t[j].strvalue;
break;
}
}
if (gametypestr)
CONS_Printf(M_GetText("Current gametype is %s\n"), gametypestr);
else // string for current gametype was not found above (should never happen)
CONS_Printf(M_GetText("Unknown gametype set (%d)\n"), gametype);
}
/** Plays the intro.