diff options
Diffstat (limited to 'linden/indra/newview/llaudiosourcevo.cpp')
-rw-r--r-- | linden/indra/newview/llaudiosourcevo.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/linden/indra/newview/llaudiosourcevo.cpp b/linden/indra/newview/llaudiosourcevo.cpp index b0e0758..fac2e7b 100644 --- a/linden/indra/newview/llaudiosourcevo.cpp +++ b/linden/indra/newview/llaudiosourcevo.cpp | |||
@@ -3,6 +3,8 @@ | |||
3 | * @author Douglas Soo, James Cook | 3 | * @author Douglas Soo, James Cook |
4 | * @brief Audio sources attached to viewer objects | 4 | * @brief Audio sources attached to viewer objects |
5 | * | 5 | * |
6 | * $LicenseInfo:firstyear=2006&license=viewergpl$ | ||
7 | * | ||
6 | * Copyright (c) 2006-2007, Linden Research, Inc. | 8 | * Copyright (c) 2006-2007, Linden Research, Inc. |
7 | * | 9 | * |
8 | * Second Life Viewer Source Code | 10 | * Second Life Viewer Source Code |
@@ -25,6 +27,7 @@ | |||
25 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | 27 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO |
26 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 28 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
27 | * COMPLETENESS OR PERFORMANCE. | 29 | * COMPLETENESS OR PERFORMANCE. |
30 | * $/LicenseInfo$ | ||
28 | */ | 31 | */ |
29 | 32 | ||
30 | #include "llviewerprecompiledheaders.h" | 33 | #include "llviewerprecompiledheaders.h" |
@@ -70,7 +73,23 @@ void LLAudioSourceVO::updateGain() | |||
70 | BOOL mute = FALSE; | 73 | BOOL mute = FALSE; |
71 | if (gParcelMgr) | 74 | if (gParcelMgr) |
72 | { | 75 | { |
73 | LLVector3d pos_global = mObjectp->getPositionGlobal(); | 76 | LLVector3d pos_global; |
77 | |||
78 | if (mObjectp->isAttachment()) | ||
79 | { | ||
80 | LLViewerObject* parent = mObjectp; | ||
81 | while (parent | ||
82 | && !parent->isAvatar()) | ||
83 | { | ||
84 | parent = (LLViewerObject*)parent->getParent(); | ||
85 | } | ||
86 | if (parent) | ||
87 | pos_global = parent->getPositionGlobal(); | ||
88 | } | ||
89 | |||
90 | else | ||
91 | pos_global = mObjectp->getPositionGlobal(); | ||
92 | |||
74 | if (!gParcelMgr->canHearSound(pos_global)) | 93 | if (!gParcelMgr->canHearSound(pos_global)) |
75 | { | 94 | { |
76 | mute = TRUE; | 95 | mute = TRUE; |