From db29fc1a01eaf74a2a5971eae6b369b58c623346 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 10 Dec 2019 17:25:45 +0100 Subject: [PATCH] - removed the mostly useless changelevel CCMDs. It makes more sense to do a real 'map' CCMD instead once the level management is working properly. --- source/blood/src/osdcmd.cpp | 46 ---------- source/duke3d/src/osdcmds.cpp | 67 +-------------- source/rr/src/cheats.cpp | 2 +- source/rr/src/osdcmds.cpp | 156 +--------------------------------- source/rr/src/screens.cpp | 3 +- 5 files changed, 4 insertions(+), 270 deletions(-) diff --git a/source/blood/src/osdcmd.cpp b/source/blood/src/osdcmd.cpp index c1ecb4715..b8d38f114 100644 --- a/source/blood/src/osdcmd.cpp +++ b/source/blood/src/osdcmd.cpp @@ -47,51 +47,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. BEGIN_BLD_NS -static int osdcmd_changelevel(osdcmdptr_t parm) -{ - int32_t volume,level; - char *p; - - if (parm->numparms != 2) return OSDCMD_SHOWHELP; - - volume = strtol(parm->parms[0], &p, 10) - 1; - if (p[0]) return OSDCMD_SHOWHELP; - level = strtol(parm->parms[1], &p, 10) - 1; - if (p[0]) return OSDCMD_SHOWHELP; - - if (volume < 0) return OSDCMD_SHOWHELP; - if (level < 0) return OSDCMD_SHOWHELP; - - if (volume >= 6) - { - OSD_Printf("changelevel: invalid volume number (range 1-%d)\n",6); - return OSDCMD_OK; - } - - if (level >= gEpisodeInfo[volume].nLevels) - { - OSD_Printf("changelevel: invalid level number\n"); - return OSDCMD_SHOWHELP; - } - - if (gDemo.at1) - gDemo.StopPlayback(); - - if (numplayers > 1) - { - gPacketStartGame.episodeId = volume; - gPacketStartGame.levelId = level; - netBroadcastNewGame(); - gStartNewGame = 1; - return OSDCMD_OK; - } - levelSetupOptions(volume, level); - StartLevel(&gGameOptions); - viewResizeView(gViewSize); - - return OSDCMD_OK; -} - static int osdcmd_map(osdcmdptr_t parm) { char filename[BMAX_PATH]; @@ -342,7 +297,6 @@ void onvideomodechange(int32_t newmode) int32_t registerosdcommands(void) { - OSD_RegisterFunction("changelevel","changelevel : warps to the given level", osdcmd_changelevel); OSD_RegisterFunction("map","map : loads the given user map", osdcmd_map); OSD_RegisterFunction("demo","demo : starts the given demo", osdcmd_demo); OSD_RegisterFunction("crosshaircolor","crosshaircolor: changes the crosshair color", osdcmd_crosshaircolor); diff --git a/source/duke3d/src/osdcmds.cpp b/source/duke3d/src/osdcmds.cpp index d39dbdd8f..92004f793 100644 --- a/source/duke3d/src/osdcmds.cpp +++ b/source/duke3d/src/osdcmds.cpp @@ -38,68 +38,6 @@ BEGIN_DUKE_NS struct osdcmd_cheatsinfo osdcmd_cheatsinfo_stat = { -1, 0, 0 }; -static int osdcmd_changelevel(osdcmdptr_t parm) -{ - int volume = 0; - int level; - - if (!VOLUMEONE) - { - if (parm->numparms != 2) return OSDCMD_SHOWHELP; - - volume = strtol(parm->parms[0], NULL, 10) - 1; - level = strtol(parm->parms[1], NULL, 10) - 1; - } - else - { - if (parm->numparms != 1) return OSDCMD_SHOWHELP; - - level = strtol(parm->parms[0], NULL, 10) - 1; - } - - if (volume < 0 || level < 0) - return OSDCMD_SHOWHELP; - - if (level > MAXLEVELS || mapList[volume * MAXLEVELS + level].fileName.IsEmpty()) - { - OSD_Printf("changelevel: no map defined for episode %d level %d\n", volume + 1, level + 1); - return OSDCMD_SHOWHELP; - } - - if (numplayers > 1) - { - return OSDCMD_OK; - } - - if (g_player[myconnectindex].ps->gm & MODE_GAME) - { - // in-game behave like a cheat - osdcmd_cheatsinfo_stat.cheatnum = CHEAT_SCOTTY; - osdcmd_cheatsinfo_stat.volume = volume; - osdcmd_cheatsinfo_stat.level = level; - } - else - { - // out-of-game behave like a menu command - osdcmd_cheatsinfo_stat.cheatnum = -1; - - ud.m_volume_number = volume; - m_level_number = level; - - ud.m_monsters_off = 0; - ud.monsters_off = 0; - - ud.m_respawn_items = 0; - ud.m_respawn_inventory = 0; - - ud.multimode = 1; - - G_NewGame_EnterLevel(); - } - - return OSDCMD_OK; -} - static int osdcmd_map(osdcmdptr_t parm) { char filename[BMAX_PATH]; @@ -856,11 +794,8 @@ int32_t registerosdcommands(void) OSD_RegisterFunction("playerinfo", "Prints information about the current player", osdcmd_playerinfo); #endif - if (VOLUMEONE) - OSD_RegisterFunction("changelevel","changelevel : warps to the given level", osdcmd_changelevel); - else + if (!VOLUMEONE) { - OSD_RegisterFunction("changelevel","changelevel : warps to the given level", osdcmd_changelevel); OSD_RegisterFunction("map","map : loads the given user map", osdcmd_map); OSD_RegisterFunction("demo","demo : starts the given demo", osdcmd_demo); } diff --git a/source/rr/src/cheats.cpp b/source/rr/src/cheats.cpp index 3c01dea68..67be9c56f 100644 --- a/source/rr/src/cheats.cpp +++ b/source/rr/src/cheats.cpp @@ -25,7 +25,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "duke3d.h" #include "osdcmds.h" #include "cheats.h" -#inclide "mapinfo.h" +#include "mapinfo.h" BEGIN_RR_NS diff --git a/source/rr/src/osdcmds.cpp b/source/rr/src/osdcmds.cpp index 1c57d4316..57b59fec9 100644 --- a/source/rr/src/osdcmds.cpp +++ b/source/rr/src/osdcmds.cpp @@ -35,115 +35,6 @@ BEGIN_RR_NS struct osdcmd_cheatsinfo osdcmd_cheatsinfo_stat = { -1, 0, 0 }; -static int osdcmd_changelevel(osdcmdptr_t parm) -{ - int32_t volume=0,level; - char *p; - - if (!VOLUMEONE) - { - if (parm->numparms != 2) return OSDCMD_SHOWHELP; - - volume = strtol(parm->parms[0], &p, 10) - 1; - if (p[0]) return OSDCMD_SHOWHELP; - level = strtol(parm->parms[1], &p, 10) - 1; - if (p[0]) return OSDCMD_SHOWHELP; - } - else - { - if (parm->numparms != 1) return OSDCMD_SHOWHELP; - - level = strtol(parm->parms[0], &p, 10) - 1; - if (p[0]) return OSDCMD_SHOWHELP; - } - - if (volume < 0) return OSDCMD_SHOWHELP; - if (level < 0) return OSDCMD_SHOWHELP; - - if (!VOLUMEONE) - { - if (volume > g_volumeCnt) - { - OSD_Printf("changelevel: invalid volume number (range 1-%d)\n",g_volumeCnt); - return OSDCMD_OK; - } - } - - if (level > MAXLEVELS || mapList *MAXLEVELS+level].fileName.IsEmpty) - { - OSD_Printf("changelevel: invalid level number\n"); - return OSDCMD_SHOWHELP; - } - - if (numplayers > 1) - { - /* - if (g_netServer) - Net_NewGame(volume,level); - else if (voting == -1) - { - ud.m_volume_number = volume; - m_level_number = level; - - if (g_player[myconnectindex].ps->i) - { - int32_t i; - - for (i=0; igm & MODE_GAME) - { - // in-game behave like a cheat - osdcmd_cheatsinfo_stat.cheatnum = CHEAT_SCOTTY; - osdcmd_cheatsinfo_stat.volume = volume; - osdcmd_cheatsinfo_stat.level = level; - } - else - { - // out-of-game behave like a menu command - osdcmd_cheatsinfo_stat.cheatnum = -1; - - ud.m_volume_number = volume; - m_level_number = level; - - ud.m_monsters_off = 0; - ud.monsters_off = 0; - - ud.m_respawn_items = 0; - ud.m_respawn_inventory = 0; - - ud.multimode = 1; - - G_NewGame_EnterLevel(); - } - - return OSDCMD_OK; -} - static int osdcmd_map(osdcmdptr_t parm) { char filename[BMAX_PATH]; @@ -170,48 +61,6 @@ static int osdcmd_map(osdcmdptr_t parm) if (numplayers > 1) { - /* - if (g_netServer) - { - Net_SendUserMapName(); - ud.m_volume_number = 0; - m_level_number = 7; - Net_NewGame(ud.m_volume_number, m_level_number); - } - else if (voting == -1) - { - Net_SendUserMapName(); - - ud.m_volume_number = 0; - m_level_number = 7; - - if (g_player[myconnectindex].ps->i) - { - int32_t i; - - for (i=0; i: warps to the given level", osdcmd_changelevel); - else + if (!VOLUMEONE) { - OSD_RegisterFunction("changelevel","changelevel : warps to the given level", osdcmd_changelevel); OSD_RegisterFunction("map","map : loads the given user map", osdcmd_map); OSD_RegisterFunction("demo","demo : starts the given demo", osdcmd_demo); } diff --git a/source/rr/src/screens.cpp b/source/rr/src/screens.cpp index 1d1d95ba1..0685b1468 100644 --- a/source/rr/src/screens.cpp +++ b/source/rr/src/screens.cpp @@ -2876,8 +2876,7 @@ void G_BonusScreenRRRA(int32_t bonusonly) menutext(191, yy, tempbuf); yy+=yystep; } - if (mapList[G_LastMapInfoIndex()].designerT - ime) + if (mapList[G_LastMapInfoIndex()].designerTime) { G_PrintDesignerTime(); menutext(191, yy, tempbuf);