From 8853f9c7c628db6932a2bcd40cd40ec524e7d371 Mon Sep 17 00:00:00 2001 From: driAn Date: Tue, 16 Jan 2007 20:43:50 +0000 Subject: [PATCH] no message git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@835 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- config/sounds.cfg | 1 + source/src/clientgame.cpp | 1 + source/src/clients2c.cpp | 7 ++++++- source/src/sound.h | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/config/sounds.cfg b/config/sounds.cfg index c6274a02..af9a47ba 100755 --- a/config/sounds.cfg +++ b/config/sounds.cfg @@ -40,6 +40,7 @@ registersound "weapon/grenade_throw" // S_GRENADETHROW registersound "weapon/pistol_akreload" // S_RAKIMBO registersound "misc/change_gun" // S_GUNCHANGE registersound "player/gib" // S_GIB +registersound "misc/headshot" // S_HEADSHOT alias fade [ // 0=in, 1=out alias stepsize 5 diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index 89855e32..94a05abb 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -497,6 +497,7 @@ void selfdamage(int damage, int actor, playerent *act, bool gib, playerent *pl) deathstate(pl); pl->lifesequence++; playsound(S_DIE1+rnd(2), pl!=player1 ? &pl->o : NULL); + if(act && act->gunselect == GUN_SNIPER && gib) playsound(S_HEADSHOT); if(gib) addgib(pl); if(pl!=player1 || act->type==ENT_BOT) act->frags += gib ? 2 : 1; } diff --git a/source/src/clients2c.cpp b/source/src/clients2c.cpp index 606d4210..8b0ef044 100644 --- a/source/src/clients2c.cpp +++ b/source/src/clients2c.cpp @@ -255,14 +255,17 @@ void parsemessages(int cn, playerent *d, ucharbuf &p) { if(!d) return; int actor = getint(p); + playerent *act; s_sprintfd(death)("%s", gib ? "GIBBED" : "fragged"); if(actor==cn) { conoutf("\f2%s suicided", d->name); + act = d; } else if(actor==clientnum) { + act = player1; int frags; if(isteam(player1->team, d->team)) { @@ -284,6 +287,7 @@ void parsemessages(int cn, playerent *d, ucharbuf &p) playerent *a = getclient(actor); if(a) { + act = a; if(isteam(a->team, d->team)) { conoutf("\f2%s %s his teammate (%s)", a->name, death, d->name); @@ -296,6 +300,7 @@ void parsemessages(int cn, playerent *d, ucharbuf &p) }; }; playsound(S_DIE1+rnd(2), &d->o); + if(act && act->gunselect == GUN_SNIPER && gib) playsound(S_HEADSHOT); if(!c2si) d->lifesequence++; gib = false; break; @@ -510,7 +515,7 @@ void parsemessages(int cn, playerent *d, ucharbuf &p) case SV_FORCETEAM: { changeteam(getint(p)); - if(!m_arena || firstplayer) spawnplayer(player1); + if(!m_arena || firstplayer) spawnplayer(player1); break; }; diff --git a/source/src/sound.h b/source/src/sound.h index e4d1cace..b28d349b 100644 --- a/source/src/sound.h +++ b/source/src/sound.h @@ -18,7 +18,7 @@ enum S_GRUNT1, S_GRUNT2, S_RUMBLE, S_FLAGDROP, S_FLAGPICKUP, S_FLAGRETURN, S_FLAGSCORE, S_GRENADEPULL, S_GRENADETHROW, - S_RAKIMBO, S_GUNCHANGE, S_GIB, + S_RAKIMBO, S_GUNCHANGE, S_GIB, S_HEADSHOT, S_NULL };