Stylistic changes and such.

This commit is contained in:
Inusaito Sayori
2014-09-07 12:40:46 -04:00
parent a732635e75
commit b127dd514d
3 changed files with 6 additions and 15 deletions

View File

@@ -812,6 +812,8 @@ void LLAgent::toggleFlying()
bool LLAgent::enableFlying()
{
BOOL sitting = FALSE;
static LLCachedControl<bool> continue_flying_on_unsit(gSavedSettings, "LiruContinueFlyingOnUnsit", false);
if (!continue_flying_on_unsit)
if (isAgentAvatarValid())
{
sitting = gAgentAvatarp->isSitting();

View File

@@ -243,12 +243,11 @@ void audio_update_wind(bool fade)
volume_delta = (LLFrameTimer::getFrameDeltaTimeF32() / WIND_SOUND_TRANSITION_TIME) * max_wind_volume;
}
static LLCachedControl<bool> MuteWind("MuteWind");
static LLCachedControl<bool> ContinueFlying("LiruContinueFlyingOnUnsit");
static LLCachedControl<bool> MuteWind(gSavedSettings, "MuteWind", false);
static LLCachedControl<bool> 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

View File

@@ -3981,17 +3981,7 @@ class LLWorldEnableFly : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
BOOL sitting = FALSE;
static LLCachedControl<bool> 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;
}
};