From b4d33fe0e1b8328f4a2b78b8182388b15419d5e5 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Fri, 19 Jul 2013 18:10:02 -0400 Subject: [PATCH] Fix up some logic with always allow fly The fly button on the toolbar would enable itself despite RLVa restrictions - This was because always fly was checked after gAgent.canFly(), despite the fact that gAgent.canFly() itself checks always fly setting at the correct time. When teleporting to a region that blocks flying, the agent would start flying due to a strange check inherited from upstream.. My opinion is, they want gods to fly, but that's kinda strange too, so I've changed it to set flying false in this case. --- indra/newview/lltoolbar.cpp | 3 +-- indra/newview/llviewermessage.cpp | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/indra/newview/lltoolbar.cpp b/indra/newview/lltoolbar.cpp index 2d07e1c05..78d3f21bf 100644 --- a/indra/newview/lltoolbar.cpp +++ b/indra/newview/lltoolbar.cpp @@ -294,7 +294,6 @@ void LLToolBar::refresh() return; static LLCachedControl show("ShowToolBar", true); - static LLCachedControl ascent_fly_always_enabled("AscentFlyAlwaysEnabled", true); static LLCachedControl ascent_build_always_enabled("AscentBuildAlwaysEnabled", true); BOOL mouselook = gAgentCamera.cameraMouselook(); setVisible(show && !mouselook); @@ -310,7 +309,7 @@ void LLToolBar::refresh() sitting = gAgentAvatarp->isSitting(); } - mFlyBtn->setEnabled((gAgent.canFly() || gAgent.getFlying() || ascent_fly_always_enabled) && !sitting ); + mFlyBtn->setEnabled((gAgent.canFly() || gAgent.getFlying()) && !sitting ); mBuildBtn->setEnabled((LLViewerParcelMgr::getInstance()->allowAgentBuild() || ascent_build_always_enabled)); // Check to see if we're in build mode diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index f27cd010d..6c79abe58 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -4605,7 +4605,7 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) if (gAgent.getRegion()->getBlockFly()) { - gAgent.setFlying(gAgent.canFly()); + gAgent.setFlying(false/*gAgent.canFly()*/); } // force simulator to recognize busy state