- made Blood's 'map' CCMD more useful by properly handling internal maps the same as 'levelwarp'.

This commit is contained in:
Christoph Oelckers 2020-01-25 20:21:49 +01:00
parent be0242e919
commit 51d5236216

View file

@ -41,6 +41,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "sound.h" #include "sound.h"
#include "sfx.h" #include "sfx.h"
#include "view.h" #include "view.h"
#include "mapinfo.h"
BEGIN_BLD_NS BEGIN_BLD_NS
@ -48,6 +49,9 @@ void LevelWarp(int nEpisode, int nLevel);
static int osdcmd_map(osdcmdptr_t parm) static int osdcmd_map(osdcmdptr_t parm)
{ {
if (parm->numparms != 1)
return OSDCMD_SHOWHELP;
char filename[BMAX_PATH]; char filename[BMAX_PATH];
strcpy(filename, parm->parms[0]); strcpy(filename, parm->parms[0]);
@ -59,6 +63,18 @@ static int osdcmd_map(osdcmdptr_t parm)
return OSDCMD_OK; 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) if (gDemo.at1)
gDemo.StopPlayback(); gDemo.StopPlayback();