Add: bootmap

Added bootmap into MAINCFG as an optional map booter (without -warp)
This commit is contained in:
yellowtd 2017-02-03 21:50:59 -05:00
parent 7af7b7f494
commit 55b31841d5
4 changed files with 38 additions and 0 deletions

View file

@ -1339,6 +1339,22 @@ void D_SRB2Main(void)
ultimatemode = true;
}
// rei/miru: bootmap (Idea: starts the game on a predefined map)
if (bootmap && !(M_CheckParm("-warp") && M_IsNextParm()))
{
pstartmap = bootmap;
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("BOOT_MAP: %d\n", bootmap);
if (autostart || netgame || M_CheckParm("+connect") || M_CheckParm("-connect"))
{
gameaction = ga_nothing;

View file

@ -3097,6 +3097,22 @@ static void readmaincfg(MYFILE *f)
DEH_WriteUndoline(word, customversionstring, UNDO_NONE);
strlcpy(customversionstring, word2, sizeof (customversionstring));
}
else if (fastcmp(word, "BOOTMAP"))
{
// rei/miru: bootmap definition for maincfg
// Support using the actual map name,
// i.e., Level AB, Level FZ, etc.
// Convert to map number
if (word2[0] >= 'A' && word2[0] <= 'Z')
value = M_MapNumber(word2[0], word2[1]);
else
value = get_number(word2);
DEH_WriteUndoline(word, va("%d", bootmap), UNDO_NONE);
bootmap = (INT16)value;
}
else
deh_warning("Maincfg: unknown word '%s'", word);
}

View file

@ -124,6 +124,9 @@ extern INT16 spstage_start;
extern INT16 sstage_start;
extern INT16 sstage_end;
extern INT16 bootmap; // rei/miru: bootmap for loading a map on startup (skips intro+title)
//extern INT16 returnTobootmap; // rei/miru: return to bootmap when attempting to go to the REAL title?
extern boolean looptitle;
extern boolean useNightsSS;

View file

@ -119,6 +119,9 @@ INT16 spstage_start;
INT16 sstage_start;
INT16 sstage_end;
INT16 bootmap; // rei/miru: bootmap for loading a map on startup (skips intro+title)
//INT16 returnTobootmap; // rei/miru: return to bootmap when attempting to go to the REAL title?
boolean looptitle = false;
boolean useNightsSS = false;