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.
This commit is contained in:
Lirusaito
2013-07-19 18:10:02 -04:00
parent ab19bfb70e
commit b4d33fe0e1
2 changed files with 2 additions and 3 deletions

View File

@@ -294,7 +294,6 @@ void LLToolBar::refresh()
return;
static LLCachedControl<bool> show("ShowToolBar", true);
static LLCachedControl<bool> ascent_fly_always_enabled("AscentFlyAlwaysEnabled", true);
static LLCachedControl<bool> 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

View File

@@ -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