If we move the -warp code down, map searching can be used
This commit is contained in:
parent
0a014755b9
commit
404f3c13e4
34
src/d_main.c
34
src/d_main.c
|
@ -1118,26 +1118,6 @@ void D_SRB2Main(void)
|
||||||
if (M_CheckParm("-server") || dedicated)
|
if (M_CheckParm("-server") || dedicated)
|
||||||
netgame = server = true;
|
netgame = server = true;
|
||||||
|
|
||||||
if (M_CheckParm("-warp") && M_IsNextParm())
|
|
||||||
{
|
|
||||||
const char *word = M_GetNextParm();
|
|
||||||
char ch; // use this with sscanf to catch non-digits with
|
|
||||||
if (fastncmp(word, "MAP", 3)) // MAPxx name
|
|
||||||
pstartmap = M_MapNumber(word[3], word[4]);
|
|
||||||
else if (sscanf(word, "%d%c", &pstartmap, &ch) != 1) // a plain number
|
|
||||||
I_Error("Cannot warp to map %s (invalid map name)\n", word);
|
|
||||||
// Don't check if lump exists just yet because the wads haven't been loaded!
|
|
||||||
// Just do a basic range check here.
|
|
||||||
if (pstartmap < 1 || pstartmap > NUMMAPS)
|
|
||||||
I_Error("Cannot warp to map %d (out of range)\n", pstartmap);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (!M_CheckParm("-server"))
|
|
||||||
G_SetGameModified(true);
|
|
||||||
autostart = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CONS_Printf("Z_Init(): Init zone memory allocation daemon. \n");
|
CONS_Printf("Z_Init(): Init zone memory allocation daemon. \n");
|
||||||
Z_Init();
|
Z_Init();
|
||||||
|
|
||||||
|
@ -1194,6 +1174,20 @@ void D_SRB2Main(void)
|
||||||
|
|
||||||
mainwadstally = packetsizetally; // technically not accurate atm, remember to port the two-stage -file process from kart in 2.2.x
|
mainwadstally = packetsizetally; // technically not accurate atm, remember to port the two-stage -file process from kart in 2.2.x
|
||||||
|
|
||||||
|
if (M_CheckParm("-warp") && M_IsNextParm())
|
||||||
|
{
|
||||||
|
const char *word = M_GetNextParm();
|
||||||
|
pstartmap = G_FindMapByNameOrCode(word, 0);
|
||||||
|
if (! pstartmap)
|
||||||
|
I_Error("Cannot find a map remotely named '%s'\n", word);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!M_CheckParm("-server"))
|
||||||
|
G_SetGameModified(true);
|
||||||
|
autostart = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
cht_Init();
|
cht_Init();
|
||||||
|
|
||||||
//---------------------------------------------------- READY SCREEN
|
//---------------------------------------------------- READY SCREEN
|
||||||
|
|
Loading…
Reference in New Issue