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.
This commit is contained in:
Inusaito Sayori
2013-05-20 12:14:58 -04:00
parent 370b41e7b0
commit ee785f0f17
3 changed files with 14 additions and 2 deletions

View File

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

View File

@@ -307,7 +307,12 @@ void LLToolBar::refresh()
setVisible(show && !mouselook);
BOOL sitting = FALSE;
if (gAgentAvatarp)
static LLCachedControl<bool> continue_flying_on_unsit("LiruContinueFlyingOnUnsit");
if (continue_flying_on_unsit)
{
sitting = false;
}
else if (gAgentAvatarp)
{
sitting = gAgentAvatarp->isSitting();
}

View File

@@ -3984,7 +3984,12 @@ class LLWorldEnableFly : public view_listener_t
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
BOOL sitting = FALSE;
if (gAgentAvatarp)
static LLCachedControl<bool> continue_flying_on_unsit("LiruContinueFlyingOnUnsit");
if (continue_flying_on_unsit)
{
sitting = false;
}
else if (gAgentAvatarp)
{
sitting = gAgentAvatarp->isSitting();
}