From b127dd514d97eb0fa52169d965fb0dc278a5c470 Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Sun, 7 Sep 2014 12:40:46 -0400 Subject: [PATCH] Stylistic changes and such. --- indra/newview/llagent.cpp | 2 ++ indra/newview/llvieweraudio.cpp | 7 +++---- indra/newview/llviewermenu.cpp | 12 +----------- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 013c45c14..a8fa1568b 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -812,6 +812,8 @@ void LLAgent::toggleFlying() bool LLAgent::enableFlying() { BOOL sitting = FALSE; + static LLCachedControl continue_flying_on_unsit(gSavedSettings, "LiruContinueFlyingOnUnsit", false); + if (!continue_flying_on_unsit) if (isAgentAvatarValid()) { sitting = gAgentAvatarp->isSitting(); diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp index 8f7a0ed65..164419dce 100644 --- a/indra/newview/llvieweraudio.cpp +++ b/indra/newview/llvieweraudio.cpp @@ -243,12 +243,11 @@ void audio_update_wind(bool fade) volume_delta = (LLFrameTimer::getFrameDeltaTimeF32() / WIND_SOUND_TRANSITION_TIME) * max_wind_volume; } - static LLCachedControl MuteWind("MuteWind"); - static LLCachedControl ContinueFlying("LiruContinueFlyingOnUnsit"); + static LLCachedControl MuteWind(gSavedSettings, "MuteWind", false); + static LLCachedControl ContinueFlying(gSavedSettings, "LiruContinueFlyingOnUnsit", false); // mute wind entirely when the user asked or when the user is seated, but flying - if (MuteWind || (ContinueFlying && gAgentAvatarp&& gAgentAvatarp->isSitting())) + if (MuteWind || (ContinueFlying && gAgentAvatarp && gAgentAvatarp->isSitting())) { - // volume decreases by itself gAudiop->mMaxWindGain = 0.f; } // mute wind when not /*flying*/ in air diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index d9c88d91e..1c671f314 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -3981,17 +3981,7 @@ class LLWorldEnableFly : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - BOOL sitting = FALSE; - static LLCachedControl continue_flying_on_unsit("LiruContinueFlyingOnUnsit"); - if (continue_flying_on_unsit) - { - sitting = false; - } - else if (gAgentAvatarp) - { - sitting = gAgentAvatarp->isSitting(); - } - gMenuHolder->findControl(userdata["control"].asString())->setValue(!sitting); + gMenuHolder->findControl(userdata["control"].asString())->setValue(gAgent.enableFlying()); return true; } };