diff options
-rw-r--r-- | src/d_main.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/d_main.c b/src/d_main.c index 9d3e0076..f77c55cf 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1617,14 +1617,22 @@ void D_DoomMain (void) p = M_CheckParm ("-warp"); if (p && p < myargc-1) { - if (gamemode == commercial) - startmap = atoi (myargv[p+1]); - else - { - startepisode = myargv[p+1][0]-'0'; - startmap = myargv[p+2][0]-'0'; - } - autostart = true; + if (gamemode == commercial) + startmap = atoi (myargv[p+1]); + else + { + startepisode = myargv[p+1][0]-'0'; + + if (p + 2 < myargc) + { + startmap = myargv[p+2][0]-'0'; + } + else + { + startmap = 1; + } + } + autostart = true; } // Invoked by setup to test the controls. |