diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index f61699b9..952904f7 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -810,7 +810,7 @@ bool tryrespawn() return false; } -VARP(hitsound, 0, 0, 1); +VARP(hitsound, 0, 0, 2); // client kill messages void setkillmessage(int gun, bool gib, const char *message) @@ -861,7 +861,7 @@ void dodamage(int damage, playerent *pl, playerent *actor, int gun, bool gib, bo } if(actor==h && pl!=actor) { - if(hitsound && lasthit != lastmillis) audiomgr.playsound(S_HITSOUND, SP_HIGH); + if( (hitsound == 1 || (hitsound && h != player1) ) && lasthit != lastmillis) audiomgr.playsound(S_HITSOUND, SP_HIGH); lasthit = lastmillis; } diff --git a/source/src/weapon.cpp b/source/src/weapon.cpp index f2369fbe..87c24a28 100644 --- a/source/src/weapon.cpp +++ b/source/src/weapon.cpp @@ -406,13 +406,17 @@ void hit(int damage, playerent *d, playerent *at, const vec &vel, int gun, bool { if(d==player1 || d->type==ENT_BOT || !m_mp(gamemode)) d->hitpush(damage, vel, at, gun); -// if(at!=player1 && d==player1) -// { -// extern int hitsound; -// extern int lasthit; -// if(hitsound && lasthit != lastmillis) audiomgr.playsound(S_HITSOUND); -// lasthit = lastmillis; -// } + if(at == player1 && d != player1) + { + extern int hitsound; + extern int lasthit; + if(hitsound == 2 && lasthit != lastmillis) + { + defformatstring(hitsnd)("sound %d %d;", S_HITSOUND, SP_HIGHEST); + addsleep(60, hitsnd); + } + lasthit = lastmillis; + } if(!m_mp(gamemode)) dodamage(damage, d, at, gun, gib); else