Implement sh_announcescideath

This commit is contained in:
Xylemon 2023-04-25 04:12:34 -07:00
parent f76b3f17b1
commit bdafdf9db0
2 changed files with 16 additions and 10 deletions

View file

@ -137,5 +137,11 @@ var int autocvar_sh_scialert = FALSE;
/* default speed for scientists */ /* default speed for scientists */
var int autocvar_sh_scispeed = 40; 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 */ /* an override for sh_scimax */
var int autocvarsh_scimax_override = 0; var int autocvarsh_scimax_override = 0;

View file

@ -15,8 +15,6 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
var int autocvar_sh_insanity = 10;
void void
HLGameRules::RestartRound(void) HLGameRules::RestartRound(void)
{ {
@ -281,14 +279,16 @@ HLGameRules::ScientistKill(NSClientPlayer pp, entity sci)
{ {
player pl = (player)pp; player pl = (player)pp;
/* obituary networking */ /* obituary networking */
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET); if (cvar("sh_announcescideath") == 1) {
WriteByte(MSG_MULTICAST, EV_OBITUARY); WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteString(MSG_MULTICAST, pl.netname); WriteByte(MSG_MULTICAST, EV_OBITUARY);
WriteString(MSG_MULTICAST, sci.netname); WriteString(MSG_MULTICAST, pl.netname);
WriteByte(MSG_MULTICAST, g_dmg_iWeapon); WriteString(MSG_MULTICAST, sci.netname);
WriteByte(MSG_MULTICAST, 0); WriteByte(MSG_MULTICAST, g_dmg_iWeapon);
msg_entity = world; WriteByte(MSG_MULTICAST, 0);
multicast([0,0,0], MULTICAST_ALL); msg_entity = world;
multicast([0,0,0], MULTICAST_ALL);
}
/* give players a frag per scientist they kill */ /* give players a frag per scientist they kill */
pl.frags++; pl.frags++;