2x jump now only plays for local player
This commit is contained in:
@@ -275,7 +275,7 @@ bool SoundManager::OnPlayBackgroundMusic(const Events::PlayBackgroundMusic & e)
|
|||||||
auto listenerComponents = m_World->GetComponents("Listener");
|
auto listenerComponents = m_World->GetComponents("Listener");
|
||||||
for (auto it = listenerComponents->begin(); it != listenerComponents->end(); it++) {
|
for (auto it = listenerComponents->begin(); it != listenerComponents->end(); it++) {
|
||||||
if ((*it).EntityID != m_LocalPlayer.ID) {
|
if ((*it).EntityID != m_LocalPlayer.ID) {
|
||||||
continue;;
|
continue;
|
||||||
}
|
}
|
||||||
auto emitterChild = m_World->CreateEntity((*it).EntityID);
|
auto emitterChild = m_World->CreateEntity((*it).EntityID);
|
||||||
auto emitter = m_World->AttachComponent(emitterChild, "SoundEmitter");
|
auto emitter = m_World->AttachComponent(emitterChild, "SoundEmitter");
|
||||||
|
|||||||
@@ -145,9 +145,11 @@ bool SoundSystem::OnDoubleJump(const Events::DoubleJump & e)
|
|||||||
if (!IsClient) {
|
if (!IsClient) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//Events::PlaySoundOnEntity ev;
|
if (e.entityID == LocalPlayer.ID) {
|
||||||
//ev.Emitter = EntityWrapper(m_World, e.entityID);
|
Events::PlaySoundOnEntity ev;
|
||||||
//ev.FilePath = "Audio/Jump/Jump2.wav";
|
ev.Emitter = EntityWrapper(m_World, e.entityID);
|
||||||
//m_EventBroker->Publish(ev);
|
ev.FilePath = "Audio/Jump/Jump2.wav";
|
||||||
|
m_EventBroker->Publish(ev);
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user