Skip to content

Commit 91d7247

Browse files
committed
Only play FireEchoSound when in an area not marked as indoors
1 parent e72201e commit 91d7247

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Entities/HDFirearm.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "ThrownDevice.h"
2323
#include "MOPixel.h"
2424
#include "Actor.h"
25+
#include "Scene.h"
2526

2627
namespace RTE {
2728

@@ -1062,7 +1063,12 @@ void HDFirearm::Update()
10621063
if (m_FireSound && !(m_FireSound->GetLoopSetting() == -1 && m_FireSound->IsBeingPlayed())) {
10631064
m_FireSound->Play(m_Pos);
10641065
}
1065-
if (m_FireEchoSound) { m_FireEchoSound->Play(m_Pos); }
1066+
if (m_FireEchoSound) {
1067+
Scene::Area* noEchoArea = g_SceneMan.GetScene()->GetOptionalArea("IndoorArea");
1068+
if (noEchoArea == nullptr || !noEchoArea->IsInside(m_Pos)) {
1069+
m_FireEchoSound->Play(m_Pos);
1070+
}
1071+
}
10661072
}
10671073

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

0 commit comments

Comments
 (0)