diff --git a/src/c_dispatch.cpp b/src/c_dispatch.cpp index 76b6e395d..2bd255405 100644 --- a/src/c_dispatch.cpp +++ b/src/c_dispatch.cpp @@ -627,7 +627,14 @@ void C_DoCommand (const char *cmd, int keynum) } else { - new DStoredCommand (com, beg); + if (len == 4 && strnicmp(beg, "warp", 4) == 0) + { + StoredWarp = beg; + } + else + { + new DStoredCommand (com, beg); + } } } else diff --git a/src/d_main.cpp b/src/d_main.cpp index 507938519..f0e7e7676 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -218,6 +218,7 @@ int NoWipe; // [RH] Allow wipe? (Needs to be set each time) bool singletics = false; // debug flag to cancel adaptiveness FString startmap; bool autostart; +FString StoredWarp; bool advancedemo; FILE *debugfile; event_t events[MAXEVENTS]; @@ -2081,7 +2082,7 @@ static void CheckCmdLine() { startmap = "&wt@01"; } - autostart = false; + autostart = StoredWarp.IsNotEmpty(); const char *val = Args->CheckValue ("-skill"); if (val) @@ -2529,6 +2530,11 @@ void D_DoomMain (void) if (demorecording) G_BeginRecording (startmap); G_InitNew (startmap, false); + if (StoredWarp.IsNotEmpty()) + { + AddCommandString(StoredWarp.LockBuffer()); + StoredWarp = NULL; + } } else { diff --git a/src/doomstat.h b/src/doomstat.h index 2819f1bf0..92ab5b8f8 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -59,6 +59,8 @@ extern FString startmap; // [RH] Actual map name now extern bool autostart; +extern FString StoredWarp; // [RH] +warp at the command line + // Selected by user. EXTERN_CVAR (Int, gameskill); extern int NextSkill; // [RH] Skill to use at next level load