diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 9c25305f7..52e2e3271 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -65,7 +65,7 @@ static void Got_ExitLevelcmd(UINT8 **cp, INT32 playernum); static void Got_RequestAddfilecmd(UINT8 **cp, INT32 playernum); static void Got_Addfilecmd(UINT8 **cp, INT32 playernum); static void Got_Pause(UINT8 **cp, INT32 playernum); -static void Got_Respawn(UINT8 **cp, INT32 playernum); +static void Got_Suicide(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); @@ -117,7 +117,7 @@ static void Command_Addfile(void); static void Command_ListWADS_f(void); static void Command_RunSOC(void); static void Command_Pause(void); -static void Command_Respawn(void); +static void Command_Suicide(void); static void Command_Version_f(void); #ifdef UPDATE_ALERT @@ -394,7 +394,7 @@ const char *netxcmdnames[MAXNETXCMD - 1] = "REQADDFILE", "DELFILE", // replace next time we add an XD "SETMOTD", - "RESPAWN", + "SUICIDE", #ifdef HAVE_BLUA "LUACMD", "LUAVAR" @@ -429,7 +429,7 @@ void D_RegisterServerCommands(void) RegisterNetXCmd(XD_ADDFILE, Got_Addfilecmd); RegisterNetXCmd(XD_REQADDFILE, Got_RequestAddfilecmd); RegisterNetXCmd(XD_PAUSE, Got_Pause); - RegisterNetXCmd(XD_RESPAWN, Got_Respawn); + RegisterNetXCmd(XD_SUICIDE, Got_Suicide); RegisterNetXCmd(XD_RUNSOC, Got_RunSOCcmd); #ifdef HAVE_BLUA RegisterNetXCmd(XD_LUACMD, Got_Luacmd); @@ -454,7 +454,7 @@ void D_RegisterServerCommands(void) COM_AddCommand("map", Command_Map_f); COM_AddCommand("exitgame", Command_ExitGame_f); - //COM_AddCommand("retry", Command_Retry_f); + COM_AddCommand("retry", Command_Retry_f); COM_AddCommand("exitlevel", Command_ExitLevel_f); COM_AddCommand("showmap", Command_Showmap_f); COM_AddCommand("mapmd5", Command_Mapmd5_f); @@ -464,7 +464,7 @@ void D_RegisterServerCommands(void) COM_AddCommand("runsoc", Command_RunSOC); COM_AddCommand("pause", Command_Pause); - COM_AddCommand("respawn", Command_Respawn); + COM_AddCommand("suicide", Command_Suicide); COM_AddCommand("gametype", Command_ShowGametype_f); COM_AddCommand("version", Command_Version_f); @@ -2029,7 +2029,7 @@ static void Got_Pause(UINT8 **cp, INT32 playernum) } // Command for stuck characters in netgames, griefing, etc. -static void Command_Respawn(void) +static void Command_Suicide(void) { UINT8 buf[4]; UINT8 *cp = buf; @@ -2046,33 +2046,25 @@ static void Command_Respawn(void) return; } - // Retry is quicker. + // Retry is quicker. Probably should force people to use it. if (!(netgame || multiplayer)) { - if (!&players[consoleplayer] || players[consoleplayer].lives <= 1) - CONS_Printf(M_GetText("You can't use this without any lives remaining!\n")); - else if (G_IsSpecialStage(gamemap)) - CONS_Printf(M_GetText("You can't retry special stages!\n")); - else - { - M_ClearMenus(true); - G_SetRetryFlag(); - } + CONS_Printf(M_GetText("You can't use this in Single Player! Use \"retry\" instead.\n")); return; } WRITEINT32(cp, consoleplayer); - SendNetXCmd(XD_RESPAWN, &buf, 4); + SendNetXCmd(XD_SUICIDE, &buf, 4); } -static void Got_Respawn(UINT8 **cp, INT32 playernum) +static void Got_Suicide(UINT8 **cp, INT32 playernum) { - INT32 respawnplayer = READINT32(*cp); + INT32 suicideplayer = READINT32(*cp); - // You can't respawn someone else. Nice try, there. + // You can't suicide someone else. Nice try, there. if (respawnplayer != playernum || (!G_PlatformGametype())) { - CONS_Alert(CONS_WARNING, M_GetText("Illegal respawn command received from %s\n"), player_names[playernum]); + CONS_Alert(CONS_WARNING, M_GetText("Illegal suicide command received from %s\n"), player_names[playernum]); if (server) { UINT8 buf[2]; @@ -2084,8 +2076,8 @@ static void Got_Respawn(UINT8 **cp, INT32 playernum) return; } - if (players[respawnplayer].mo) - P_DamageMobj(players[respawnplayer].mo, NULL, NULL, 1, DMG_INSTAKILL); + if (players[suicideplayer].mo) + P_DamageMobj(players[suicideplayer].mo, NULL, NULL, 1, DMG_INSTAKILL); } /** Deals with an ::XD_RANDOMSEED message in a netgame. @@ -4126,8 +4118,6 @@ void Command_ExitGame_f(void) D_StartTitle(); } -// see Command_Respawn() -#if 0 void Command_Retry_f(void) { if (!(gamestate == GS_LEVEL || gamestate == GS_INTERMISSION)) @@ -4144,7 +4134,6 @@ void Command_Retry_f(void) G_SetRetryFlag(); } } -#endif #ifdef NETGAME_DEVMODE // Allow the use of devmode in netgames. diff --git a/src/d_netcmd.h b/src/d_netcmd.h index 728b27680..3e3c61112 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -136,7 +136,7 @@ typedef enum XD_REQADDFILE, // 17 XD_DELFILE, // 18 - replace next time we add an XD XD_SETMOTD, // 19 - XD_RESPAWN, // 20 + XD_SUICIDE, // 20 XD_DEMOTED, // 21 #ifdef HAVE_BLUA XD_LUACMD, // 22 @@ -192,7 +192,7 @@ void D_RegisterServerCommands(void); void D_RegisterClientCommands(void); void D_SendPlayerConfig(void); void Command_ExitGame_f(void); -//void Command_Retry_f(void); +void Command_Retry_f(void); void D_GameTypeChanged(INT32 lastgametype); // not a real _OnChange function anymore void D_MapChange(INT32 pmapnum, INT32 pgametype, boolean pultmode, boolean presetplayers, INT32 pdelay, boolean pskipprecutscene, boolean pfromlevelselect); boolean IsPlayerAdmin(INT32 playernum);