From 51d52362162b5543271301b60db343813f8753ad Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 25 Jan 2020 20:21:49 +0100 Subject: [PATCH] - made Blood's 'map' CCMD more useful by properly handling internal maps the same as 'levelwarp'. --- source/blood/src/osdcmd.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/source/blood/src/osdcmd.cpp b/source/blood/src/osdcmd.cpp index 05eca775f..34ea77d6f 100644 --- a/source/blood/src/osdcmd.cpp +++ b/source/blood/src/osdcmd.cpp @@ -41,6 +41,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "sound.h" #include "sfx.h" #include "view.h" +#include "mapinfo.h" BEGIN_BLD_NS @@ -48,6 +49,9 @@ void LevelWarp(int nEpisode, int nLevel); static int osdcmd_map(osdcmdptr_t parm) { + if (parm->numparms != 1) + return OSDCMD_SHOWHELP; + char filename[BMAX_PATH]; strcpy(filename, parm->parms[0]); @@ -59,6 +63,18 @@ static int osdcmd_map(osdcmdptr_t parm) return OSDCMD_OK; } + for (int i = 0; i < 512; i++) + { + if (mapList[i].labelName.CompareNoCase(filename) == 0) + { + int e = i / kMaxLevels; + int m = i % kMaxLevels; + LevelWarp(e, m); + return OSDCMD_OK; + } + } + // Map has not been defined. Treat as user map. + if (gDemo.at1) gDemo.StopPlayback();