From 66650c0a4b7dbb96b29e8ca717af0bdf4f2c4e8d Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sat, 16 Dec 2006 23:12:40 +0000 Subject: Allow -warp 1 to warp to E1M1, -warp 2 -> E2M1, etc. when playing Doom 1. Thanks for RazTK for pointing this out. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 783 --- src/d_main.c | 24 ++++++++++++++++-------- 1 file 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. -- cgit v1.2.3