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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user