diff --git a/source/blood/src/osdcmd.cpp b/source/blood/src/osdcmd.cpp index a4ba3767c..05eca775f 100644 --- a/source/blood/src/osdcmd.cpp +++ b/source/blood/src/osdcmd.cpp @@ -44,7 +44,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. BEGIN_BLD_NS -extern CCheatMgr gCheatMgr; +void LevelWarp(int nEpisode, int nLevel); static int osdcmd_map(osdcmdptr_t parm) { @@ -221,7 +221,20 @@ static int osdcmd_activatecheat(osdcmdptr_t parm) } } - +static int osdcmd_levelwarp(osdcmdptr_t parm) +{ + if (parm->numparms != 2) + return OSDCMD_SHOWHELP; + int e = atoi(parm->parms[0]); + int m = atoi(parm->parms[1]); + if (e == 0 || m == 0) + { + Printf("Invalid level!: E%sM%s\n", parm->parms[0], parm->parms[1]); + return OSDCMD_OK; + } + LevelWarp(e - 1, m - 1); + return OSDCMD_OK; +} int32_t registerosdcommands(void) { @@ -234,6 +247,8 @@ int32_t registerosdcommands(void) OSD_RegisterFunction("activatecheat","activatecheat : activates a classic cheat code", osdcmd_activatecheat); + OSD_RegisterFunction("levelwarp","levelwarp : warp to episode 'e' and map 'm'", osdcmd_levelwarp); + return 0; }