SL-10687 FIXED Audio error when trying to fly when flying is not available

meow-7.2.2
maxim_productengine 2019-03-06 17:26:51 +02:00
parent ba24af923c
commit fdbcb3fa76
3 changed files with 14 additions and 5 deletions

View File

@ -742,7 +742,7 @@ BOOL LLAgent::getFlying() const
//-----------------------------------------------------------------------------
// setFlying()
//-----------------------------------------------------------------------------
void LLAgent::setFlying(BOOL fly)
void LLAgent::setFlying(BOOL fly, BOOL fail_sound)
{
if (isAgentAvatarValid())
{
@ -771,7 +771,10 @@ void LLAgent::setFlying(BOOL fly)
// parcel doesn't let you start fly
// gods can always fly
// and it's OK if you're already flying
make_ui_sound("UISndBadKeystroke");
if (fail_sound)
{
make_ui_sound("UISndBadKeystroke");
}
return;
}
if( !was_flying )

View File

@ -337,7 +337,7 @@ private:
//--------------------------------------------------------------------
public:
BOOL getFlying() const;
void setFlying(BOOL fly);
void setFlying(BOOL fly, BOOL fail_sound = FALSE);
static void toggleFlying();
static bool enableFlying();
BOOL canFly(); // Does this parcel allow you to fly?

View File

@ -64,7 +64,12 @@ LLViewerKeyboard gViewerKeyboard;
void agent_jump( EKeystate s )
{
if( KEYSTATE_UP == s ) return;
static BOOL first_fly_attempt(TRUE);
if (KEYSTATE_UP == s)
{
first_fly_attempt = TRUE;
return;
}
F32 time = gKeyboard->getCurKeyElapsedTime();
S32 frame_count = ll_round(gKeyboard->getCurKeyElapsedFrameCount());
@ -77,7 +82,8 @@ void agent_jump( EKeystate s )
}
else
{
gAgent.setFlying(TRUE);
gAgent.setFlying(TRUE, first_fly_attempt);
first_fly_attempt = FALSE;
gAgent.moveUp(1);
}
}