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 */
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;

View file

@ -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++;