mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-04-22 02:00:50 +00:00
Warn if the gametype is not valid at all!
(cherry picked from commit 7776c59cddaa4cc09dfdb2f15192a194fda36eb7)
This commit is contained in:
parent
7c3aedc48e
commit
a5bf7719e7
1 changed files with 14 additions and 8 deletions
|
@ -2671,15 +2671,21 @@ static void Command_Map_f(void)
|
|||
|
||||
if (!gametype_cons_t[i].strvalue) // reached end of the list with no match
|
||||
{
|
||||
d = atoi(gametypename);
|
||||
// assume they gave us a gametype number, which is okay too
|
||||
for (i = 0; gametype_cons_t[i].strvalue != NULL; i++)
|
||||
/* Did they give us a gametype number? That's okay too! */
|
||||
if (isdigit(gametypename[0]))
|
||||
{
|
||||
if (d == gametype_cons_t[i].value)
|
||||
{
|
||||
newgametype = gametype_cons_t[i].value;
|
||||
break;
|
||||
}
|
||||
d = atoi(gametypename);
|
||||
if (d >= 0 && d < NUMGAMETYPES)
|
||||
newgametype = d;
|
||||
}
|
||||
else
|
||||
{
|
||||
CONS_Alert(CONS_ERROR,
|
||||
"'%s' is not a gametype.\n",
|
||||
gametypename);
|
||||
Z_Free(realmapname);
|
||||
Z_Free(mapname);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue