mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-03-06 11:21:10 +00:00
Merge branch 'skill-option' into 'master'
-skill launcher option See merge request KartKrew/Kart!34
This commit is contained in:
commit
db332478d5
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…
Add table
Reference in a new issue