diff --git a/src/d_main.c b/src/d_main.c index cf3c35a45..7694f6683 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -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; diff --git a/src/dehacked.c b/src/dehacked.c index dde986a47..b80a3ceb7 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -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); } diff --git a/src/doomstat.h b/src/doomstat.h index 4aa7984b7..f5bbb692f 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -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; diff --git a/src/g_game.c b/src/g_game.c index c38b722ed..f8034bd24 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -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;