aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llaudiosourcevo.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:42 -0500
committerJacek Antonelli2008-08-15 23:45:42 -0500
commitce28e056c20bf2723f565bbf464b87781ec248a2 (patch)
treeef7b0501c4de4b631a916305cbc2a5fdc125e52d /linden/indra/newview/llaudiosourcevo.cpp
parentSecond Life viewer sources 1.19.1.4b (diff)
downloadmeta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.zip
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.gz
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.bz2
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.xz
Second Life viewer sources 1.20.2
Diffstat (limited to 'linden/indra/newview/llaudiosourcevo.cpp')
-rw-r--r--linden/indra/newview/llaudiosourcevo.cpp46
1 files changed, 22 insertions, 24 deletions
diff --git a/linden/indra/newview/llaudiosourcevo.cpp b/linden/indra/newview/llaudiosourcevo.cpp
index ae8ce5d..e668078 100644
--- a/linden/indra/newview/llaudiosourcevo.cpp
+++ b/linden/indra/newview/llaudiosourcevo.cpp
@@ -71,51 +71,49 @@ void LLAudioSourceVO::updateGain()
71 } 71 }
72 72
73 BOOL mute = FALSE; 73 BOOL mute = FALSE;
74 if (gParcelMgr) 74 LLVector3d pos_global;
75 {
76 LLVector3d pos_global;
77 75
78 if (mObjectp->isAttachment()) 76 if (mObjectp->isAttachment())
77 {
78 LLViewerObject* parent = mObjectp;
79 while (parent && !parent->isAvatar())
79 { 80 {
80 LLViewerObject* parent = mObjectp; 81 parent = (LLViewerObject*)parent->getParent();
81 while (parent
82 && !parent->isAvatar())
83 {
84 parent = (LLViewerObject*)parent->getParent();
85 }
86 if (parent)
87 pos_global = parent->getPositionGlobal();
88 } 82 }
89 83 if (parent)
90 else
91 pos_global = mObjectp->getPositionGlobal();
92
93 if (!gParcelMgr->canHearSound(pos_global))
94 { 84 {
95 mute = TRUE; 85 pos_global = parent->getPositionGlobal();
96 } 86 }
97 } 87 }
88 else
89 {
90 pos_global = mObjectp->getPositionGlobal();
91 }
92
93 if (!LLViewerParcelMgr::getInstance()->canHearSound(pos_global))
94 {
95 mute = TRUE;
96 }
98 97
99 if (!mute && gMuteListp) 98 if (!mute)
100 { 99 {
101 if (gMuteListp->isMuted(mObjectp->getID())) 100 if (LLMuteList::getInstance()->isMuted(mObjectp->getID()))
102 { 101 {
103 mute = TRUE; 102 mute = TRUE;
104 } 103 }
105 else if (gMuteListp->isMuted(mOwnerID, LLMute::flagObjectSounds)) 104 else if (LLMuteList::getInstance()->isMuted(mOwnerID, LLMute::flagObjectSounds))
106 { 105 {
107 mute = TRUE; 106 mute = TRUE;
108 } 107 }
109 else if (mObjectp->isAttachment()) 108 else if (mObjectp->isAttachment())
110 { 109 {
111 LLViewerObject* parent = mObjectp; 110 LLViewerObject* parent = mObjectp;
112 while (parent 111 while (parent && !parent->isAvatar())
113 && !parent->isAvatar())
114 { 112 {
115 parent = (LLViewerObject*)parent->getParent(); 113 parent = (LLViewerObject*)parent->getParent();
116 } 114 }
117 if (parent 115 if (parent
118 && gMuteListp->isMuted(parent->getID())) 116 && LLMuteList::getInstance()->isMuted(parent->getID()))
119 { 117 {
120 mute = TRUE; 118 mute = TRUE;
121 } 119 }