diff --git a/src/c_cmds.cpp b/src/c_cmds.cpp index b45210053b..f1085555a1 100644 --- a/src/c_cmds.cpp +++ b/src/c_cmds.cpp @@ -364,11 +364,14 @@ CCMD (changemap) if (argv.argc() > 1) { + const char *mapname = argv[1]; + if (!strcmp(mapname, "*")) mapname = level.MapName.GetChars(); + try { - if (!P_CheckMapData(argv[1])) + if (!P_CheckMapData(mapname)) { - Printf ("No map %s\n", argv[1]); + Printf ("No map %s\n", mapname); } else { @@ -381,7 +384,7 @@ CCMD (changemap) { Net_WriteByte (DEM_CHANGEMAP); } - Net_WriteString (argv[1]); + Net_WriteString (mapname); } } catch(CRecoverableError &error) diff --git a/src/g_level.cpp b/src/g_level.cpp index 4139362c35..3367a348bd 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -182,11 +182,14 @@ CCMD (map) } if (argv.argc() > 1) { + const char *mapname = argv[1]; + if (!strcmp(mapname, "*")) mapname = level.MapName.GetChars(); + try { - if (!P_CheckMapData(argv[1])) + if (!P_CheckMapData(mapname)) { - Printf ("No map %s\n", argv[1]); + Printf ("No map %s\n", mapname); } else { @@ -200,7 +203,7 @@ CCMD (map) deathmatch = true; multiplayernext = true; } - G_DeferedInitNew (argv[1]); + G_DeferedInitNew (mapname); } } catch(CRecoverableError &error) @@ -229,11 +232,14 @@ CCMD(recordmap) } if (argv.argc() > 2) { + const char *mapname = argv[2]; + if (!strcmp(mapname, "*")) mapname = level.MapName.GetChars(); + try { - if (!P_CheckMapData(argv[2])) + if (!P_CheckMapData(mapname)) { - Printf("No map %s\n", argv[2]); + Printf("No map %s\n", mapname); } else { @@ -247,7 +253,7 @@ CCMD(recordmap) deathmatch = true; multiplayernext = true; } - G_DeferedInitNew(argv[2]); + G_DeferedInitNew(mapname); gameaction = ga_recordgame; newdemoname = argv[1]; newdemomap = argv[2];