about summary refs log tree commit diff
path: root/src/game/server/entities
diff options
context:
space:
mode:
authorChoupom <andycootlapin@hotmail.fr>2011-06-02 11:44:35 +0200
committeroy <Tom_Adams@web.de>2011-06-11 18:33:30 +0200
commit558b110504af146322d36cc7ac0e65bd2e408e99 (patch)
treeb148cb926e5603c7b04f9da539616b12c182051b /src/game/server/entities
parenteae1a972976cc19f9c790849200d2dd307e20e3e (diff)
downloadzcatch-558b110504af146322d36cc7ac0e65bd2e408e99.tar.gz
zcatch-558b110504af146322d36cc7ac0e65bd2e408e99.zip
fixed #633 Correct sound effects in following spectactor mode
Diffstat (limited to 'src/game/server/entities')
-rw-r--r--src/game/server/entities/character.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/game/server/entities/character.cpp b/src/game/server/entities/character.cpp
index e5cca2b8..d1e1e8eb 100644
--- a/src/game/server/entities/character.cpp
+++ b/src/game/server/entities/character.cpp
@@ -756,7 +756,15 @@ bool CCharacter::TakeDamage(vec2 Force, int Dmg, int From, int Weapon)
 
 	// do damage Hit sound
 	if(From >= 0 && From != m_pPlayer->GetCID() && GameServer()->m_apPlayers[From])
-		GameServer()->CreateSound(GameServer()->m_apPlayers[From]->m_ViewPos, SOUND_HIT, CmaskOne(From));
+	{
+		int Mask = CmaskOne(From);
+		for(int i = 0; i < MAX_CLIENTS; i++)
+		{
+			if(GameServer()->m_apPlayers[i] && GameServer()->m_apPlayers[i]->GetTeam() == TEAM_SPECTATORS && GameServer()->m_apPlayers[i]->m_SpectatorID == From)
+				Mask |= CmaskOne(i);
+		}
+		GameServer()->CreateSound(GameServer()->m_apPlayers[From]->m_ViewPos, SOUND_HIT, Mask);
+	}
 
 	// check for death
 	if(m_Health <= 0)