2x jump now only plays for local player

This commit is contained in:
stiffly
2016-03-12 15:31:44 +01:00
parent 9bac141a6b
commit cc10e5500b
2 changed files with 7 additions and 5 deletions
+1 -1
View File
@@ -275,7 +275,7 @@ bool SoundManager::OnPlayBackgroundMusic(const Events::PlayBackgroundMusic & e)
auto listenerComponents = m_World->GetComponents("Listener");
for (auto it = listenerComponents->begin(); it != listenerComponents->end(); it++) {
if ((*it).EntityID != m_LocalPlayer.ID) {
continue;;
continue;
}
auto emitterChild = m_World->CreateEntity((*it).EntityID);
auto emitter = m_World->AttachComponent(emitterChild, "SoundEmitter");
+6 -4
View File
@@ -145,9 +145,11 @@ bool SoundSystem::OnDoubleJump(const Events::DoubleJump & e)
if (!IsClient) {
return false;
}
//Events::PlaySoundOnEntity ev;
//ev.Emitter = EntityWrapper(m_World, e.entityID);
//ev.FilePath = "Audio/Jump/Jump2.wav";
//m_EventBroker->Publish(ev);
if (e.entityID == LocalPlayer.ID) {
Events::PlaySoundOnEntity ev;
ev.Emitter = EntityWrapper(m_World, e.entityID);
ev.FilePath = "Audio/Jump/Jump2.wav";
m_EventBroker->Publish(ev);
}
return false;
}