From bdafdf9db082d68d03f045a2eb1f874275ba7649 Mon Sep 17 00:00:00 2001 From: Xylemon Date: Tue, 25 Apr 2023 04:12:34 -0700 Subject: [PATCH] Implement sh_announcescideath --- src/server/gamerules.h | 6 ++++++ src/server/gamerules.qc | 20 ++++++++++---------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/server/gamerules.h b/src/server/gamerules.h index a4a7aa9..ac739c1 100644 --- a/src/server/gamerules.h +++ b/src/server/gamerules.h @@ -137,5 +137,11 @@ var int autocvar_sh_scialert = FALSE; /* default speed for scientists */ var int autocvar_sh_scispeed = 40; +/* enable scientist obituaries */ +var int autocvar_sh_announcescideath = 1; + +/* default kills required for insanity */ +var int autocvar_sh_insanity = 5; + /* an override for sh_scimax */ var int autocvarsh_scimax_override = 0; \ No newline at end of file diff --git a/src/server/gamerules.qc b/src/server/gamerules.qc index 35d8014..41fab1a 100644 --- a/src/server/gamerules.qc +++ b/src/server/gamerules.qc @@ -15,8 +15,6 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -var int autocvar_sh_insanity = 10; - void HLGameRules::RestartRound(void) { @@ -281,14 +279,16 @@ HLGameRules::ScientistKill(NSClientPlayer pp, entity sci) { player pl = (player)pp; /* obituary networking */ - WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET); - WriteByte(MSG_MULTICAST, EV_OBITUARY); - WriteString(MSG_MULTICAST, pl.netname); - WriteString(MSG_MULTICAST, sci.netname); - WriteByte(MSG_MULTICAST, g_dmg_iWeapon); - WriteByte(MSG_MULTICAST, 0); - msg_entity = world; - multicast([0,0,0], MULTICAST_ALL); + if (cvar("sh_announcescideath") == 1) { + WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET); + WriteByte(MSG_MULTICAST, EV_OBITUARY); + WriteString(MSG_MULTICAST, pl.netname); + WriteString(MSG_MULTICAST, sci.netname); + WriteByte(MSG_MULTICAST, g_dmg_iWeapon); + WriteByte(MSG_MULTICAST, 0); + msg_entity = world; + multicast([0,0,0], MULTICAST_ALL); + } /* give players a frag per scientist they kill */ pl.frags++;