From 8d4ce113e45371b0e36c15aba8ee8335cc59feb1 Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 5 Nov 2018 12:49:28 +0000 Subject: [PATCH 1/3] Redo the `help` command stuff, this time with much less impact on other areas of the code for sanity as we approach R1. --- src/command.c | 40 +++++++++++++++++++++++++++++++++------- src/console.c | 6 +++--- src/d_netcmd.c | 22 +++++++++++----------- src/p_mobj.c | 2 +- src/r_main.c | 4 ++-- 5 files changed, 50 insertions(+), 24 deletions(-) diff --git a/src/command.c b/src/command.c index 3ca7cb3a..b7d9f927 100644 --- a/src/command.c +++ b/src/command.c @@ -672,7 +672,8 @@ static void COM_Help_f(void) if (COM_Argc() > 1) { - cvar = CV_FindVar(COM_Argv(1)); + const char *help = COM_Argv(1); + cvar = CV_FindVar(help); if (cvar) { CONS_Printf(M_GetText("Variable %s:\n"), cvar->name); @@ -721,12 +722,37 @@ static void COM_Help_f(void) CONS_Printf(M_GetText(" Current value: %d\n"), cvar->value); } else - CONS_Printf(M_GetText("No help for this command/variable\n")); + { + CONS_Printf("\x87%s", M_GetText("No exact match, searching...\n")); + //CONS_Printf(M_GetText("No help for this command/variable\n")); + // commands + CONS_Printf("\x82%s", M_GetText("Commands:\n")); + for (cmd = com_commands; cmd; cmd = cmd->next) + { + if (strstr(cmd->name, help)) + CONS_Printf("%s ",cmd->name); + i++; + } + + // variables + CONS_Printf("\n\x82%s", M_GetText("Variables:\n")); + for (cvar = consvar_vars; cvar; cvar = cvar->next) + { + if (!(cvar->flags & CV_NOSHOWHELP) && (strstr(cvar->name, help))) + CONS_Printf("%s ", cvar->name); + i++; + } + + CONS_Printf("\n\x87%s", M_GetText("Check wiki.srb2.org for more or type help \n")); + + CONS_Debug(DBG_GAMELOGIC, "\x87Total : %d\n", i); + } + return; } - else + { // commands - CONS_Printf("\x82%s", M_GetText("Commands\n")); + CONS_Printf("\x82%s", M_GetText("Commands:\n")); for (cmd = com_commands; cmd; cmd = cmd->next) { CONS_Printf("%s ",cmd->name); @@ -734,7 +760,7 @@ static void COM_Help_f(void) } // variables - CONS_Printf("\n\x82%s", M_GetText("Variables\n")); + CONS_Printf("\n\x82%s", M_GetText("Variables:\n")); for (cvar = consvar_vars; cvar; cvar = cvar->next) { if (!(cvar->flags & CV_NOSHOWHELP)) @@ -742,9 +768,9 @@ static void COM_Help_f(void) i++; } - CONS_Printf("\n\x82%s", M_GetText("Read help file for more or type help \n")); + CONS_Printf("\n\x87%s", M_GetText("Check wiki.srb2.org for more or type help \n")); - CONS_Debug(DBG_GAMELOGIC, "\x82Total : %d\n", i); + CONS_Debug(DBG_GAMELOGIC, "\x87Total : %d\n", i); } } diff --git a/src/console.c b/src/console.c index 88ef0b49..f7efa4a9 100644 --- a/src/console.c +++ b/src/console.c @@ -202,11 +202,11 @@ static void CONS_Clear_f(void) // Choose english keymap // -static void CONS_English_f(void) +/*static void CONS_English_f(void) { shiftxform = english_shiftxform; CONS_Printf(M_GetText("%s keymap.\n"), M_GetText("English")); -} +}*/ static char *bindtable[NUMINPUTS]; @@ -392,7 +392,7 @@ void CON_Init(void) // register our commands // COM_AddCommand("cls", CONS_Clear_f); - COM_AddCommand("english", CONS_English_f); + //COM_AddCommand("english", CONS_English_f); // set console full screen for game startup MAKE SURE VID_Init() done !!! con_destlines = vid.height; con_curlines = vid.height; diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 6e598801..39aceef6 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -238,12 +238,12 @@ static consvar_t cv_dummyconsvar = {"dummyconsvar", "Off", CV_CALL|CV_NOSHOWHELP consvar_t cv_restrictskinchange = {"restrictskinchange", "No", CV_NETVAR|CV_CHEAT, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_allowteamchange = {"allowteamchange", "Yes", CV_NETVAR, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_startinglives = {"startinglives", "3", CV_NETVAR|CV_CHEAT, startingliveslimit_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_startinglives = {"startinglives", "3", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, startingliveslimit_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t respawntime_cons_t[] = {{0, "MIN"}, {30, "MAX"}, {0, NULL}}; consvar_t cv_respawntime = {"respawndelay", "1", CV_NETVAR|CV_CHEAT, respawntime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_competitionboxes = {"competitionboxes", "Random", CV_NETVAR|CV_CHEAT, competitionboxes_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_competitionboxes = {"competitionboxes", "Random", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, competitionboxes_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; #ifdef SEENAMES static CV_PossibleValue_t seenames_cons_t[] = {{0, "Off"}, {1, "Colorless"}, {2, "Team"}, {3, "Ally/Foe"}, {0, NULL}}; @@ -303,9 +303,9 @@ consvar_t cv_mouse2opt = {"mouse2opt", "0", CV_SAVE, NULL, NULL, 0, NULL, NULL, consvar_t cv_mouse2port = {"mouse2port", "COM2", CV_SAVE, mouse2port_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; #endif -consvar_t cv_matchboxes = {"matchboxes", "Normal", CV_NETVAR|CV_CHEAT, matchboxes_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_specialrings = {"specialrings", "On", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_powerstones = {"powerstones", "On", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_matchboxes = {"matchboxes", "Normal", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, matchboxes_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_specialrings = {"specialrings", "On", CV_NETVAR|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_powerstones = {"powerstones", "On", CV_NETVAR|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; /*consvar_t cv_recycler = {"tv_recycler", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_teleporters = {"tv_teleporter", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; @@ -389,8 +389,8 @@ consvar_t cv_soundtest = {"soundtest", "0", CV_CALL, NULL, SoundTest_OnChange, 0 static CV_PossibleValue_t minitimelimit_cons_t[] = {{15, "MIN"}, {9999, "MAX"}, {0, NULL}}; consvar_t cv_countdowntime = {"countdowntime", "30", CV_NETVAR|CV_CHEAT, minitimelimit_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_touchtag = {"touchtag", "Off", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_hidetime = {"hidetime", "30", CV_NETVAR|CV_CALL, minitimelimit_cons_t, Hidetime_OnChange, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_touchtag = {"touchtag", "Off", CV_NETVAR|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_hidetime = {"hidetime", "30", CV_NETVAR|CV_CALL|CV_NOSHOWHELP, minitimelimit_cons_t, Hidetime_OnChange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_autobalance = {"autobalance", "0", CV_NETVAR|CV_CALL, autobalance_cons_t, AutoBalance_OnChange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_teamscramble = {"teamscramble", "Off", CV_NETVAR|CV_CALL|CV_NOINIT, teamscramble_cons_t, TeamScramble_OnChange, 0, NULL, NULL, 0, 0, NULL}; @@ -400,13 +400,13 @@ consvar_t cv_friendlyfire = {"friendlyfire", "Off", CV_NETVAR, CV_OnOff, NULL, 0 consvar_t cv_itemfinder = {"itemfinder", "Off", CV_CALL, CV_OnOff, ItemFinder_OnChange, 0, NULL, NULL, 0, 0, NULL}; // Scoring type options -consvar_t cv_match_scoring = {"matchscoring", "Normal", CV_NETVAR|CV_CHEAT, match_scoring_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_match_scoring = {"matchscoring", "Normal", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, match_scoring_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_overtime = {"overtime", "Yes", CV_NETVAR, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_rollingdemos = {"rollingdemos", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_timetic = {"timerres", "Normal", CV_SAVE, timetic_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; // use tics in display -consvar_t cv_resetmusic = {"resetmusic", "No", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_timetic = {"timerres", "Normal", CV_SAVE|CV_NOSHOWHELP, timetic_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; // use tics in display +consvar_t cv_resetmusic = {"resetmusic", "No", CV_SAVE|CV_NOSHOWHELP, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t pointlimit_cons_t[] = {{0, "MIN"}, {999999990, "MAX"}, {0, NULL}}; consvar_t cv_pointlimit = {"pointlimit", "0", CV_NETVAR|CV_CALL|CV_NOINIT, pointlimit_cons_t, @@ -424,7 +424,7 @@ consvar_t cv_forceskin = {"forceskin", "-1", CV_NETVAR|CV_CALL|CV_CHEAT, NULL, F consvar_t cv_downloading = {"downloading", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_allowexitlevel = {"allowexitlevel", "No", CV_NETVAR, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_killingdead = {"killingdead", "Off", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_killingdead = {"killingdead", "Off", CV_NETVAR|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_netstat = {"netstat", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; // show bandwidth statistics static CV_PossibleValue_t nettimeout_cons_t[] = {{TICRATE/7, "MIN"}, {60*TICRATE, "MAX"}, {0, NULL}}; diff --git a/src/p_mobj.c b/src/p_mobj.c index cf95dc41..c797e0f3 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -10495,7 +10495,7 @@ consvar_t cv_itemrespawntime = {"respawnitemtime", "2", CV_NETVAR|CV_CHEAT, resp consvar_t cv_itemrespawn = {"respawnitem", "On", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t flagtime_cons_t[] = {{0, "MIN"}, {300, "MAX"}, {0, NULL}}; consvar_t cv_flagtime = {"flagtime", "30", CV_NETVAR|CV_CHEAT, flagtime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_suddendeath = {"suddendeath", "Off", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_suddendeath = {"suddendeath", "Off", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; void P_SpawnPrecipitation(void) { diff --git a/src/r_main.c b/src/r_main.c index 1db5989f..8d5a075b 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -152,7 +152,7 @@ void SendWeaponPref2(void); void SendWeaponPref3(void); void SendWeaponPref4(void); -consvar_t cv_tailspickup = {"tailspickup", "On", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_tailspickup = {"tailspickup", "On", CV_NETVAR|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_chasecam = {"chasecam", "On", CV_CALL, CV_OnOff, ChaseCam_OnChange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_chasecam2 = {"chasecam2", "On", CV_CALL, CV_OnOff, ChaseCam2_OnChange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_chasecam3 = {"chasecam3", "On", CV_CALL, CV_OnOff, ChaseCam3_OnChange, 0, NULL, NULL, 0, 0, NULL}; @@ -165,7 +165,7 @@ consvar_t cv_flipcam4 = {"flipcam4", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo, consvar_t cv_shadow = {"shadow", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_shadowoffs = {"offsetshadows", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_skybox = {"skybox", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_soniccd = {"soniccd", "Off", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_soniccd = {"soniccd", "On", CV_NETVAR|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_allowmlook = {"allowmlook", "Yes", CV_NETVAR, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_showhud = {"showhud", "Yes", CV_CALL, CV_YesNo, R_SetViewSize, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_translucenthud = {"translucenthud", "10", CV_SAVE, translucenthud_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; From bb251c4fbfcb1ba7d02619bd139614642c0419b7 Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 5 Nov 2018 19:02:34 +0000 Subject: [PATCH 2/3] * Re-add support for command "help" (ie, basically no help at all). * Rename "suicide" command to "respawn" so the game doesn't tell you to kill yourself when you try to get help for it. * Add a "manual" command to open the manual. --- src/command.c | 70 ++++++++++++++++++++++++++++---------------------- src/d_netcmd.c | 30 +++++++++++----------- src/d_netcmd.h | 2 +- src/m_menu.c | 17 ++++++++---- 4 files changed, 68 insertions(+), 51 deletions(-) diff --git a/src/command.c b/src/command.c index b7d9f927..18978aa7 100644 --- a/src/command.c +++ b/src/command.c @@ -676,7 +676,7 @@ static void COM_Help_f(void) cvar = CV_FindVar(help); if (cvar) { - CONS_Printf(M_GetText("Variable %s:\n"), cvar->name); + CONS_Printf("\x82""Variable %s:\n", cvar->name); CONS_Printf(M_GetText(" flags :")); if (cvar->flags & CV_SAVE) CONS_Printf("AUTOSAVE "); @@ -691,59 +691,68 @@ static void COM_Help_f(void) CONS_Printf("\n"); if (cvar->PossibleValue) { - if (stricmp(cvar->PossibleValue[0].strvalue, "MIN") == 0) + if (!stricmp(cvar->PossibleValue[0].strvalue, "MIN") && !stricmp(cvar->PossibleValue[1].strvalue, "MAX")) { - for (i = 1; cvar->PossibleValue[i].strvalue != NULL; i++) - if (!stricmp(cvar->PossibleValue[i].strvalue, "MAX")) - break; - CONS_Printf(M_GetText(" range from %d to %d\n"), cvar->PossibleValue[0].value, - cvar->PossibleValue[i].value); - CONS_Printf(M_GetText(" Current value: %d\n"), cvar->value); + CONS_Printf(" range from %d to %d\n", cvar->PossibleValue[0].value, + cvar->PossibleValue[1].value); + i = 2; } - else + { const char *cvalue = NULL; - CONS_Printf(M_GetText(" possible value : %s\n"), cvar->name); + //CONS_Printf(M_GetText(" possible value : %s\n"), cvar->name); while (cvar->PossibleValue[i].strvalue) { - CONS_Printf(" %-2d : %s\n", cvar->PossibleValue[i].value, + CONS_Printf(" %-2d : %s\n", cvar->PossibleValue[i].value, cvar->PossibleValue[i].strvalue); if (cvar->PossibleValue[i].value == cvar->value) cvalue = cvar->PossibleValue[i].strvalue; i++; } if (cvalue) - CONS_Printf(M_GetText(" Current value: %s\n"), cvalue); + CONS_Printf(" Current value: %s\n", cvalue); else - CONS_Printf(M_GetText(" Current value: %d\n"), cvar->value); + CONS_Printf(" Current value: %d\n", cvar->value); } } else - CONS_Printf(M_GetText(" Current value: %d\n"), cvar->value); + CONS_Printf(" Current value: %d\n", cvar->value); } else { - CONS_Printf("\x87%s", M_GetText("No exact match, searching...\n")); - //CONS_Printf(M_GetText("No help for this command/variable\n")); - // commands - CONS_Printf("\x82%s", M_GetText("Commands:\n")); for (cmd = com_commands; cmd; cmd = cmd->next) { - if (strstr(cmd->name, help)) - CONS_Printf("%s ",cmd->name); + if (strcmp(cmd->name, help)) + continue; + + CONS_Printf("\x82""Command %s:\n", cmd->name); + CONS_Printf(" help is not available for commands"); + CONS_Printf("\x82""\nCheck wiki.srb2.org for more or try typing without arguments\n"); + return; + } + + CONS_Printf("No exact match, searching...\n"); + // commands + CONS_Printf("\x82""Commands:\n"); + for (cmd = com_commands; cmd; cmd = cmd->next) + { + if (!strstr(cmd->name, help)) + continue; + CONS_Printf("%s ",cmd->name); i++; } // variables - CONS_Printf("\n\x82%s", M_GetText("Variables:\n")); + CONS_Printf("\x82""\nVariables:\n"); for (cvar = consvar_vars; cvar; cvar = cvar->next) { - if (!(cvar->flags & CV_NOSHOWHELP) && (strstr(cvar->name, help))) - CONS_Printf("%s ", cvar->name); + if ((cvar->flags & CV_NOSHOWHELP) || (!strstr(cvar->name, help))) + continue; + CONS_Printf("%s ", cvar->name); i++; } - CONS_Printf("\n\x87%s", M_GetText("Check wiki.srb2.org for more or type help \n")); + CONS_Printf("\x82""\nCheck wiki.srb2.org for more or type help \n"); CONS_Debug(DBG_GAMELOGIC, "\x87Total : %d\n", i); } @@ -752,7 +761,7 @@ static void COM_Help_f(void) { // commands - CONS_Printf("\x82%s", M_GetText("Commands:\n")); + CONS_Printf("\x82""Commands:\n"); for (cmd = com_commands; cmd; cmd = cmd->next) { CONS_Printf("%s ",cmd->name); @@ -760,17 +769,18 @@ static void COM_Help_f(void) } // variables - CONS_Printf("\n\x82%s", M_GetText("Variables:\n")); + CONS_Printf("\x82""\nVariables:\n"); for (cvar = consvar_vars; cvar; cvar = cvar->next) { - if (!(cvar->flags & CV_NOSHOWHELP)) - CONS_Printf("%s ", cvar->name); + if (cvar->flags & CV_NOSHOWHELP) + continue; + CONS_Printf("%s ", cvar->name); i++; } - CONS_Printf("\n\x87%s", M_GetText("Check wiki.srb2.org for more or type help \n")); + CONS_Printf("\x82""\nCheck wiki.srb2.org for more or type help \n"); - CONS_Debug(DBG_GAMELOGIC, "\x87Total : %d\n", i); + CONS_Debug(DBG_GAMELOGIC, "\x82Total : %d\n", i); } } diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 39aceef6..38e008c7 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -72,7 +72,7 @@ static void Got_Delfilecmd(UINT8 **cp, INT32 playernum); #endif static void Got_Addfilecmd(UINT8 **cp, INT32 playernum); static void Got_Pause(UINT8 **cp, INT32 playernum); -static void Got_Suicide(UINT8 **cp, INT32 playernum); +static void Got_Respawn(UINT8 **cp, INT32 playernum); static void Got_RandomSeed(UINT8 **cp, INT32 playernum); static void Got_RunSOCcmd(UINT8 **cp, INT32 playernum); static void Got_Teamchange(UINT8 **cp, INT32 playernum); @@ -136,7 +136,7 @@ static void Command_Delfile(void); #endif static void Command_RunSOC(void); static void Command_Pause(void); -static void Command_Suicide(void); +static void Command_Respawn(void); static void Command_Version_f(void); #ifdef UPDATE_ALERT @@ -479,7 +479,7 @@ const char *netxcmdnames[MAXNETXCMD - 1] = "REQADDFILE", "DELFILE", "SETMOTD", - "SUICIDE", + "RESPAWN", "DEMOTED", "SETUPVOTE", "MODIFYVOTE", @@ -511,7 +511,7 @@ void D_RegisterServerCommands(void) RegisterNetXCmd(XD_DELFILE, Got_Delfilecmd); #endif RegisterNetXCmd(XD_PAUSE, Got_Pause); - RegisterNetXCmd(XD_SUICIDE, Got_Suicide); + RegisterNetXCmd(XD_RESPAWN, Got_Respawn); RegisterNetXCmd(XD_RUNSOC, Got_RunSOCcmd); #ifdef HAVE_BLUA RegisterNetXCmd(XD_LUACMD, Got_Luacmd); @@ -554,7 +554,7 @@ void D_RegisterServerCommands(void) #endif COM_AddCommand("runsoc", Command_RunSOC); COM_AddCommand("pause", Command_Pause); - COM_AddCommand("suicide", Command_Suicide); + COM_AddCommand("respawn", Command_Respawn); COM_AddCommand("gametype", Command_ShowGametype_f); COM_AddCommand("version", Command_Version_f); @@ -2466,7 +2466,7 @@ static void Got_Pause(UINT8 **cp, INT32 playernum) } // Command for stuck characters in netgames, griefing, etc. -static void Command_Suicide(void) +static void Command_Respawn(void) { XBOXSTATIC UINT8 buf[4]; UINT8 *cp = buf; @@ -2479,7 +2479,7 @@ static void Command_Suicide(void) return; } - /*if (!G_RaceGametype()) // srb2kart: not necessary, suiciding makes you lose a bumper in battle, so it's not desirable to use as a way to escape a hit + /*if (!G_RaceGametype()) // srb2kart: not necessary, respawning makes you lose a bumper in battle, so it's not desirable to use as a way to escape a hit { CONS_Printf(M_GetText("You may only use this in co-op, race, and competition!\n")); return; @@ -2493,17 +2493,17 @@ static void Command_Suicide(void) return; }*/ - SendNetXCmd(XD_SUICIDE, &buf, 4); + SendNetXCmd(XD_RESPAWN, &buf, 4); } -static void Got_Suicide(UINT8 **cp, INT32 playernum) +static void Got_Respawn(UINT8 **cp, INT32 playernum) { - INT32 suicideplayer = READINT32(*cp); + INT32 respawnplayer = READINT32(*cp); - // You can't suicide someone else. Nice try, there. - if (suicideplayer != playernum) // srb2kart: "|| (!G_RaceGametype())" + // You can't respawn someone else. Nice try, there. + if (respawnplayer != playernum) // srb2kart: "|| (!G_RaceGametype())" { - CONS_Alert(CONS_WARNING, M_GetText("Illegal suicide command received from %s\n"), player_names[playernum]); + CONS_Alert(CONS_WARNING, M_GetText("Illegal respawn command received from %s\n"), player_names[playernum]); if (server) { XBOXSTATIC UINT8 buf[2]; @@ -2515,8 +2515,8 @@ static void Got_Suicide(UINT8 **cp, INT32 playernum) return; } - if (players[suicideplayer].mo) - P_DamageMobj(players[suicideplayer].mo, NULL, NULL, 10000); + if (players[respawnplayer].mo) + P_DamageMobj(players[respawnplayer].mo, NULL, NULL, 10000); } /** Deals with an ::XD_RANDOMSEED message in a netgame. diff --git a/src/d_netcmd.h b/src/d_netcmd.h index 366357bf..b63db9f4 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -190,7 +190,7 @@ typedef enum XD_REQADDFILE, // 17 XD_DELFILE, // 18 XD_SETMOTD, // 19 - XD_SUICIDE, // 20 + XD_RESPAWN, // 20 XD_DEMOTED, // 21 XD_SETUPVOTE, // 22 XD_MODIFYVOTE, // 23 diff --git a/src/m_menu.c b/src/m_menu.c index 659a2ce7..1fdad7e9 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -2373,6 +2373,15 @@ static void M_PrevOpt(void) // (in other words -- stop bullshit happening by mashing buttons in fades) static boolean noFurtherInput = false; +static void Command_Manual_f(void) +{ + if (modeattacking) + return; + M_StartControlPanel(); + M_Manual(INT32_MAX); + itemOn = 0; +} + // // M_Responder // @@ -2500,11 +2509,7 @@ boolean M_Responder(event_t *ev) switch (ch) { case KEY_F1: // Help key - if (modeattacking) - return true; - M_StartControlPanel(); - M_Manual(INT32_MAX); - itemOn = 0; + Command_Manual_f(); return true; case KEY_F2: // Empty @@ -3093,6 +3098,8 @@ void M_Ticker(void) // void M_Init(void) { + COM_AddCommand("manual", Command_Manual_f); + CV_RegisterVar(&cv_nextmap); CV_RegisterVar(&cv_newgametype); CV_RegisterVar(&cv_chooseskin); From 7866e882922e0e900d4e7487d1ce594df3eb1975 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 6 Nov 2018 18:54:00 +0000 Subject: [PATCH 3/3] No-show of debug stuff, and make karteliminatelast into a debug to justify its hiding. --- src/d_netcmd.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 38e008c7..397adbca 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -363,19 +363,18 @@ consvar_t cv_kartspeedometer = {"kartdisplayspeed", "Off", CV_SAVE, kartspeedome static CV_PossibleValue_t kartvoices_cons_t[] = {{0, "Never"}, {1, "Tasteful"}, {2, "Meme"}, {0, NULL}}; consvar_t cv_kartvoices = {"kartvoices", "Tasteful", CV_SAVE, kartvoices_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -// this might be a debug or it might be an undocumented regular feature -consvar_t cv_karteliminatelast = {"karteliminatelast", "Yes", CV_NETVAR|CV_CHEAT|CV_CALL, CV_OnOff, KartEliminateLast_OnChange, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_karteliminatelast = {"kartdebugeliminatelast", "Yes", CV_NETVAR|CV_CHEAT|CV_CALL|CV_NOSHOWHELP, CV_OnOff, KartEliminateLast_OnChange, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t kartdebugitem_cons_t[] = {{-1, "MIN"}, {NUMKARTITEMS-1, "MAX"}, {0, NULL}}; -consvar_t cv_kartdebugitem = {"kartdebugitem", "0", CV_NETVAR|CV_CHEAT, kartdebugitem_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_kartdebugitem = {"kartdebugitem", "0", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, kartdebugitem_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t kartdebugamount_cons_t[] = {{1, "MIN"}, {255, "MAX"}, {0, NULL}}; -consvar_t cv_kartdebugamount = {"kartdebugamount", "1", CV_NETVAR|CV_CHEAT, kartdebugamount_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_kartdebugshrink = {"kartdebugshrink", "Off", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_kartdebugdistribution = {"kartdebugdistribution", "Off", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_kartdebughuddrop = {"kartdebughuddrop", "Off", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_kartdebugamount = {"kartdebugamount", "1", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, kartdebugamount_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_kartdebugshrink = {"kartdebugshrink", "Off", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_kartdebugdistribution = {"kartdebugdistribution", "Off", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_kartdebughuddrop = {"kartdebughuddrop", "Off", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_kartdebugcheckpoint = {"kartdebugcheckpoint", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_kartdebugnodes = {"kartdebugnodes", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_kartdebugcheckpoint = {"kartdebugcheckpoint", "Off", CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_kartdebugnodes = {"kartdebugnodes", "Off", CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t votetime_cons_t[] = {{10, "MIN"}, {3600, "MAX"}, {0, NULL}}; consvar_t cv_votetime = {"votetime", "20", CV_NETVAR, votetime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};