From 27b0609a4f60ae80e4702f485a42ef87a83d0928 Mon Sep 17 00:00:00 2001 From: danij Date: Fri, 26 Jul 2013 00:52:52 +0100 Subject: [PATCH] libdoom: Handle the 'kill' command as a cheat in multiplayer --- doomsday/plugins/common/src/d_netsv.c | 3 +-- doomsday/plugins/doom/src/m_cheat.c | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/doomsday/plugins/common/src/d_netsv.c b/doomsday/plugins/common/src/d_netsv.c index 7eded264a2..eb33bc5168 100644 --- a/doomsday/plugins/common/src/d_netsv.c +++ b/doomsday/plugins/common/src/d_netsv.c @@ -1325,11 +1325,10 @@ void NetSv_ExecuteCheat(int player, char const *command) if(!strnicmp(command, "god", 3) || !strnicmp(command, "noclip", 6) || !strnicmp(command, "give", 4) -#ifdef __JHERETIC__ || !strnicmp(command, "kill", 4) +#ifdef __JHERETIC__ || !strnicmp(command, "chicken", 7) #elif __JHEXEN__ - || !strnicmp(command, "kill", 4) || !strnicmp(command, "class", 5) || !strnicmp(command, "pig", 3) || !strnicmp(command, "runscript", 9) diff --git a/doomsday/plugins/doom/src/m_cheat.c b/doomsday/plugins/doom/src/m_cheat.c index 2df39cc4aa..d8809db42c 100644 --- a/doomsday/plugins/doom/src/m_cheat.c +++ b/doomsday/plugins/doom/src/m_cheat.c @@ -646,7 +646,21 @@ D_CMD(CheatGive) D_CMD(CheatMassacre) { - Con_Printf("%i monsters killed.\n", P_Massacre()); + if(G_GameState() == GS_MAP) + { + if(IS_CLIENT) + { + NetCl_CheatRequest("kill"); + } + else if((IS_NETGAME && !netSvAllowCheats) || gameSkill == SM_NIGHTMARE) + { + return false; + } + else + { + Con_Printf("%i monsters killed.\n", P_Massacre()); + } + } return true; }