From ee785f0f17d7f2b0ad87f6eb363e819c1fb3bbaf Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Mon, 20 May 2013 12:14:58 -0400 Subject: [PATCH] Allow turning flying on and off while seated, if using Continue Fly On Unsit Note: Redundant code, but these functions will likely be merged eventually(FUI-esque project), so it doesn't matter for now. --- indra/newview/llagent.cpp | 2 ++ indra/newview/lltoolbar.cpp | 7 ++++++- indra/newview/llviewermenu.cpp | 7 ++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 88cbb340a..794f4c952 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -666,11 +666,13 @@ void LLAgent::setFlying(BOOL fly) return; } + /* Singu Note: We don't take off while sitting, don't bother with this check, let us toggle fly whenever. // don't allow taking off while sitting if (fly && gAgentAvatarp->isSitting()) { return; } + */ } if (fly) diff --git a/indra/newview/lltoolbar.cpp b/indra/newview/lltoolbar.cpp index a72c8be5b..8d4820dce 100644 --- a/indra/newview/lltoolbar.cpp +++ b/indra/newview/lltoolbar.cpp @@ -307,7 +307,12 @@ void LLToolBar::refresh() setVisible(show && !mouselook); BOOL sitting = FALSE; - if (gAgentAvatarp) + static LLCachedControl continue_flying_on_unsit("LiruContinueFlyingOnUnsit"); + if (continue_flying_on_unsit) + { + sitting = false; + } + else if (gAgentAvatarp) { sitting = gAgentAvatarp->isSitting(); } diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 43e33f2bd..fed4fee46 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -3984,7 +3984,12 @@ class LLWorldEnableFly : public view_listener_t bool handleEvent(LLPointer event, const LLSD& userdata) { BOOL sitting = FALSE; - if (gAgentAvatarp) + static LLCachedControl continue_flying_on_unsit("LiruContinueFlyingOnUnsit"); + if (continue_flying_on_unsit) + { + sitting = false; + } + else if (gAgentAvatarp) { sitting = gAgentAvatarp->isSitting(); }