mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-18 23:41:48 +00:00
Merge branch 'skill-option' into 'master'
-skill launcher option See merge request KartKrew/Kart!34
This commit is contained in:
commit
e4f2a3d7b6
1 changed files with 23 additions and 0 deletions
23
src/d_main.c
23
src/d_main.c
|
@ -1470,6 +1470,29 @@ void D_SRB2Main(void)
|
|||
}
|
||||
}
|
||||
|
||||
if (M_CheckParm("-skill") && M_IsNextParm())
|
||||
{
|
||||
INT32 j;
|
||||
INT16 newskill = -1;
|
||||
const char *sskill = M_GetNextParm();
|
||||
|
||||
for (j = 0; kartspeed_cons_t[j].strvalue; j++)
|
||||
if (!strcasecmp(kartspeed_cons_t[j].strvalue, sskill))
|
||||
{
|
||||
newskill = (INT16)kartspeed_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 >= 0 && j <= 2)
|
||||
newskill = (INT16)j;
|
||||
}
|
||||
|
||||
if (newskill != -1)
|
||||
CV_SetValue(&cv_kartspeed, newskill);
|
||||
}
|
||||
|
||||
if (server && !M_CheckParm("+map"))
|
||||
{
|
||||
// Prevent warping to nonexistent levels
|
||||
|
|
Loading…
Reference in a new issue