mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-17 07:00:59 +00:00
Support -encore parameter in new map command
This commit is contained in:
parent
de5a7d88d4
commit
6dc44c50ff
1 changed files with 23 additions and 4 deletions
|
@ -2455,6 +2455,7 @@ static void Command_Map_f(void)
|
||||||
size_t acceptableargc;
|
size_t acceptableargc;
|
||||||
size_t parm_force;
|
size_t parm_force;
|
||||||
size_t parm_gametype;
|
size_t parm_gametype;
|
||||||
|
size_t parm_encore;
|
||||||
const char *arg_gametype;
|
const char *arg_gametype;
|
||||||
/* debug? */
|
/* debug? */
|
||||||
size_t parm_noresetplayers;
|
size_t parm_noresetplayers;
|
||||||
|
@ -2470,6 +2471,7 @@ static void Command_Map_f(void)
|
||||||
char *realmapname = NULL;
|
char *realmapname = NULL;
|
||||||
|
|
||||||
INT32 newgametype = gametype;
|
INT32 newgametype = gametype;
|
||||||
|
boolean newencoremode = cv_kartencore.value;
|
||||||
|
|
||||||
INT32 i;
|
INT32 i;
|
||||||
INT32 d;
|
INT32 d;
|
||||||
|
@ -2494,6 +2496,12 @@ static void Command_Map_f(void)
|
||||||
CHECKPARM (gametype, "-g", 1) ||
|
CHECKPARM (gametype, "-g", 1) ||
|
||||||
CHECKPARM (gametype, "-gt", 1)
|
CHECKPARM (gametype, "-gt", 1)
|
||||||
);
|
);
|
||||||
|
(void)
|
||||||
|
(
|
||||||
|
CHECKPARM (encore, "-encore", 0) ||
|
||||||
|
CHECKPARM (encore, "-en", 0) ||
|
||||||
|
CHECKPARM (encore, "-e", 0)
|
||||||
|
);
|
||||||
|
|
||||||
(void)CHECKPARM (noresetplayers, "-noresetplayers", 0);
|
(void)CHECKPARM (noresetplayers, "-noresetplayers", 0);
|
||||||
|
|
||||||
|
@ -2523,12 +2531,13 @@ static void Command_Map_f(void)
|
||||||
if (COM_Argc() != acceptableargc)
|
if (COM_Argc() != acceptableargc)
|
||||||
{
|
{
|
||||||
/* I'm going over the fucking lines and I DON'T CAREEEEE */
|
/* I'm going over the fucking lines and I DON'T CAREEEEE */
|
||||||
CONS_Printf("map <name / [MAP]code / number> [-gametype <type>] [-force]:\n");
|
CONS_Printf("map <name / [MAP]code / number> [-gametype <type>] [-encore] [-force]:\n");
|
||||||
CONS_Printf(M_GetText(
|
CONS_Printf(M_GetText(
|
||||||
"Warp to a map, by its name, two character code, with optional \"MAP\" prefix, or by its number (though why would you).\n"
|
"Warp to a map, by its name, two character code, with optional \"MAP\" prefix, or by its number (though why would you).\n"
|
||||||
"All parameters are case-insensitive.\n"
|
"All parameters are case-insensitive.\n"
|
||||||
"* \"-force\" may be shortened to \"-f\".\n"
|
"* \"-force\" may be shortened to \"-f\".\n"
|
||||||
"* \"-gametype\" may be shortened to \"-g\" or \"-gt\".\n"));
|
"* \"-gametype\" may be shortened to \"-g\" or \"-gt\".\n"
|
||||||
|
"* \"-encore\" may be shortened to \"-e\" or \"-en\".\n"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2644,8 +2653,18 @@ static void Command_Map_f(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (parm_encore)
|
||||||
|
{
|
||||||
|
newencoremode = ! newencoremode;
|
||||||
|
if (! M_SecretUnlocked(SECRET_ENCORE) && newencoremode)
|
||||||
|
{
|
||||||
|
CONS_Alert(CONS_NOTICE, M_GetText("You haven't unlocked Encore Mode yet!\n"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fromlevelselect = false;
|
fromlevelselect = false;
|
||||||
D_MapChange(newmapnum, newgametype, (boolean)cv_kartencore.value, newresetplayers, 0, false, false);
|
D_MapChange(newmapnum, newgametype, newencoremode, newresetplayers, 0, false, false);
|
||||||
|
|
||||||
Z_Free(realmapname);
|
Z_Free(realmapname);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue