diff options
Diffstat (limited to 'linden/indra/newview/llviewermessage.cpp')
-rw-r--r-- | linden/indra/newview/llviewermessage.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index b20695c..5d83065 100644 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp | |||
@@ -112,6 +112,7 @@ | |||
112 | #include "llui.h" // for make_ui_sound | 112 | #include "llui.h" // for make_ui_sound |
113 | #include "lluploaddialog.h" | 113 | #include "lluploaddialog.h" |
114 | #include "llviewercamera.h" | 114 | #include "llviewercamera.h" |
115 | #include "llviewercontrol.h" | ||
115 | #include "llviewergenericmessage.h" | 116 | #include "llviewergenericmessage.h" |
116 | #include "llviewerinventory.h" | 117 | #include "llviewerinventory.h" |
117 | #include "llviewermenu.h" | 118 | #include "llviewermenu.h" |
@@ -3362,12 +3363,19 @@ void process_sound_trigger(LLMessageSystem *msg, void **) | |||
3362 | msg->getVector3Fast(_PREHASH_SoundData, _PREHASH_Position, pos_local); | 3363 | msg->getVector3Fast(_PREHASH_SoundData, _PREHASH_Position, pos_local); |
3363 | msg->getF32Fast(_PREHASH_SoundData, _PREHASH_Gain, gain); | 3364 | msg->getF32Fast(_PREHASH_SoundData, _PREHASH_Gain, gain); |
3364 | 3365 | ||
3366 | //If we have sounds muted, don't even try to load or trigger the sound. | ||
3367 | if(gSavedSettings.getBOOL("MuteSounds") || gain == 0.0) | ||
3368 | return; | ||
3369 | |||
3365 | // adjust sound location to true global coords | 3370 | // adjust sound location to true global coords |
3366 | LLVector3d pos_global = from_region_handle(region_handle); | 3371 | LLVector3d pos_global = from_region_handle(region_handle); |
3367 | pos_global.mdV[VX] += pos_local.mV[VX]; | 3372 | pos_global.mdV[VX] += pos_local.mV[VX]; |
3368 | pos_global.mdV[VY] += pos_local.mV[VY]; | 3373 | pos_global.mdV[VY] += pos_local.mV[VY]; |
3369 | pos_global.mdV[VZ] += pos_local.mV[VZ]; | 3374 | pos_global.mdV[VZ] += pos_local.mV[VZ]; |
3370 | 3375 | ||
3376 | // Don't play sounds if sound settings are muted. | ||
3377 | if (gSavedSettings.getBOOL("MuteSounds")) return; | ||
3378 | |||
3371 | // Don't play a trigger sound if you can't hear it due | 3379 | // Don't play a trigger sound if you can't hear it due |
3372 | // to parcel "local audio only" settings. | 3380 | // to parcel "local audio only" settings. |
3373 | if (!LLViewerParcelMgr::getInstance()->canHearSound(pos_global)) return; | 3381 | if (!LLViewerParcelMgr::getInstance()->canHearSound(pos_global)) return; |
@@ -3396,7 +3404,7 @@ void process_sound_trigger(LLMessageSystem *msg, void **) | |||
3396 | 3404 | ||
3397 | void process_preload_sound(LLMessageSystem *msg, void **user_data) | 3405 | void process_preload_sound(LLMessageSystem *msg, void **user_data) |
3398 | { | 3406 | { |
3399 | if (!gAudiop) | 3407 | if (!gAudiop || gSavedSettings.getBOOL("MuteSounds")) |
3400 | { | 3408 | { |
3401 | return; | 3409 | return; |
3402 | } | 3410 | } |
@@ -3449,6 +3457,9 @@ void process_attached_sound(LLMessageSystem *msg, void **user_data) | |||
3449 | msg->getF32Fast(_PREHASH_DataBlock, _PREHASH_Gain, gain); | 3457 | msg->getF32Fast(_PREHASH_DataBlock, _PREHASH_Gain, gain); |
3450 | msg->getU8Fast(_PREHASH_DataBlock, _PREHASH_Flags, flags); | 3458 | msg->getU8Fast(_PREHASH_DataBlock, _PREHASH_Flags, flags); |
3451 | 3459 | ||
3460 | if(gSavedSettings.getBOOL("MuteSounds") || gain == 0.0) | ||
3461 | return; | ||
3462 | |||
3452 | LLViewerObject *objectp = gObjectList.findObject(object_id); | 3463 | LLViewerObject *objectp = gObjectList.findObject(object_id); |
3453 | if (!objectp) | 3464 | if (!objectp) |
3454 | { | 3465 | { |