From 54a03ddc0fa3d2b4e613f7c01499baf1238a132f Mon Sep 17 00:00:00 2001 From: stiffly Date: Mon, 14 Mar 2016 01:49:37 +0100 Subject: [PATCH] Hurt sound only played for local player. --- src/Game/Systems/SoundSystem.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Game/Systems/SoundSystem.cpp b/src/Game/Systems/SoundSystem.cpp index 999e1fc9..6db01305 100644 --- a/src/Game/Systems/SoundSystem.cpp +++ b/src/Game/Systems/SoundSystem.cpp @@ -87,6 +87,9 @@ bool SoundSystem::OnPlayerDamage(const Events::PlayerDamage & e) if (!e.Victim.Valid() || !e.Inflictor.Valid()) { return false; } + if (e.Victim.ID != LocalPlayer.ID) { + return false; + } auto victimTeam = m_World->GetComponent(e.Victim.ID, "Team"); auto inflictorTeam = m_World->GetComponent(e.Inflictor.ID, "Team"); if ((int)victimTeam["Team"] == (int)inflictorTeam["Team"]) {