Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Commit

Permalink
Merge pull request #581 from cortex-command-community/scene-area-echo
Browse files Browse the repository at this point in the history
Echo Sound Changes
  • Loading branch information
Causeless authored Dec 28, 2023
2 parents ff0497c + 91d7247 commit fef9217
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Entities/HDFirearm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "ThrownDevice.h"
#include "MOPixel.h"
#include "Actor.h"
#include "Scene.h"

namespace RTE {

Expand Down Expand Up @@ -1062,7 +1063,12 @@ void HDFirearm::Update()
if (m_FireSound && !(m_FireSound->GetLoopSetting() == -1 && m_FireSound->IsBeingPlayed())) {
m_FireSound->Play(m_Pos);
}
if (m_FireEchoSound) { m_FireEchoSound->Play(m_Pos); }
if (m_FireEchoSound) {
Scene::Area* noEchoArea = g_SceneMan.GetScene()->GetOptionalArea("IndoorArea");
if (noEchoArea == nullptr || !noEchoArea->IsInside(m_Pos)) {
m_FireEchoSound->Play(m_Pos);
}
}
}

if (m_Loudness > 0) { g_MovableMan.RegisterAlarmEvent(AlarmEvent(m_Pos, m_Team, m_Loudness)); }
Expand Down

0 comments on commit fef9217

Please sign in to comment.