Use GP difficulty str values instead of hardcoded "Master" exception
This commit is contained in:
parent
387315ad0f
commit
65f4af966a
2 changed files with 20 additions and 47 deletions
|
|
@ -2031,34 +2031,20 @@ void D_SRB2Main(void)
|
|||
INT16 newskill = -1;
|
||||
const char *sskill = M_GetNextParm();
|
||||
|
||||
const char *masterstr = "Master";
|
||||
const char *nightmarestr = "NIGHTMARE";
|
||||
|
||||
if (!strcasecmp(masterstr, sskill))
|
||||
for (j = 0; gpdifficulty_cons_t[j].strvalue; j++)
|
||||
{
|
||||
newskill = KARTGP_MASTER;
|
||||
}
|
||||
else if (!strcasecmp(nightmarestr, sskill))
|
||||
{
|
||||
newskill = KARTGP_NIGHTMARE;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (j = 0; kartspeed_cons_t[j].strvalue; j++)
|
||||
if (!strcasecmp(gpdifficulty_cons_t[j].strvalue, sskill))
|
||||
{
|
||||
if (!strcasecmp(kartspeed_cons_t[j].strvalue, sskill))
|
||||
{
|
||||
newskill = (INT16)kartspeed_cons_t[j].value;
|
||||
break;
|
||||
}
|
||||
newskill = (INT16)gpdifficulty_cons_t[j].value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!kartspeed_cons_t[j].strvalue) // reached end of the list with no match
|
||||
{
|
||||
j = atoi(sskill); // assume they gave us a skill number, which is okay too
|
||||
if (j >= KARTSPEED_EASY && j <= KARTGP_NIGHTMARE)
|
||||
newskill = (INT16)j;
|
||||
}
|
||||
if (!gpdifficulty_cons_t[j].strvalue) // reached end of the list with no match
|
||||
{
|
||||
j = atoi(sskill); // assume they gave us a skill number, which is okay too
|
||||
if (j >= KARTSPEED_EASY && j <= KARTGP_NIGHTMARE)
|
||||
newskill = (INT16)j;
|
||||
}
|
||||
|
||||
if (grandprixinfo.gp == true)
|
||||
|
|
|
|||
|
|
@ -3305,37 +3305,24 @@ static void Command_Map_f(void)
|
|||
|
||||
if (option_skill)
|
||||
{
|
||||
const char *masterstr = "Master";
|
||||
const char *nightmarestr = "NIGHTMARE";
|
||||
const char *skillname = COM_Argv(option_skill + 1);
|
||||
INT32 newskill = -1;
|
||||
INT32 j;
|
||||
|
||||
if (!strcasecmp(masterstr, skillname))
|
||||
for (j = 0; gpdifficulty_cons_t[j].strvalue; j++)
|
||||
{
|
||||
newskill = KARTGP_MASTER;
|
||||
}
|
||||
else if (!strcasecmp(nightmarestr, skillname))
|
||||
{
|
||||
newskill = KARTGP_NIGHTMARE;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (j = 0; kartspeed_cons_t[j].strvalue; j++)
|
||||
if (!strcasecmp(gpdifficulty_cons_t[j].strvalue, skillname))
|
||||
{
|
||||
if (!strcasecmp(kartspeed_cons_t[j].strvalue, skillname))
|
||||
{
|
||||
newskill = (INT16)kartspeed_cons_t[j].value;
|
||||
break;
|
||||
}
|
||||
newskill = (INT16)gpdifficulty_cons_t[j].value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!kartspeed_cons_t[j].strvalue) // reached end of the list with no match
|
||||
{
|
||||
INT32 num = atoi(COM_Argv(option_skill + 1)); // assume they gave us a skill number, which is okay too
|
||||
if (num >= KARTSPEED_EASY && num <= KARTGP_NIGHTMARE)
|
||||
newskill = (INT16)num;
|
||||
}
|
||||
if (!gpdifficulty_cons_t[j].strvalue) // reached end of the list with no match
|
||||
{
|
||||
INT32 num = atoi(COM_Argv(option_skill + 1)); // assume they gave us a skill number, which is okay too
|
||||
if (num >= KARTSPEED_EASY && num <= KARTGP_NIGHTMARE)
|
||||
newskill = (INT16)num;
|
||||
}
|
||||
|
||||
if (newskill != -1)
|
||||
|
|
|
|||
Loading…
Reference in a new issue