summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Howard2006-12-16 23:12:40 +0000
committerSimon Howard2006-12-16 23:12:40 +0000
commit66650c0a4b7dbb96b29e8ca717af0bdf4f2c4e8d (patch)
tree273d94ac1340116001b29315cbddb5c753876e08
parent790a207f62517b4599dcec84c8af582782257c77 (diff)
downloadchocolate-doom-66650c0a4b7dbb96b29e8ca717af0bdf4f2c4e8d.tar.gz
chocolate-doom-66650c0a4b7dbb96b29e8ca717af0bdf4f2c4e8d.tar.bz2
chocolate-doom-66650c0a4b7dbb96b29e8ca717af0bdf4f2c4e8d.zip
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
-rw-r--r--src/d_main.c24
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.