summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authormaxim_productengine <mnikolenko@productengine.com>2019-03-06 17:26:51 +0200
committermaxim_productengine <mnikolenko@productengine.com>2019-03-06 17:26:51 +0200
commitfdbcb3fa760a81652ce29354ebb4d9362036b267 (patch)
tree123e21dafb50b81c415173799d544f8acd655467 /indra/newview
parentba24af923c87a9ab4307ab6a66c587df380f5be9 (diff)
SL-10687 FIXED Audio error when trying to fly when flying is not available
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llagent.cpp7
-rw-r--r--indra/newview/llagent.h2
-rw-r--r--indra/newview/llviewerkeyboard.cpp10
3 files changed, 14 insertions, 5 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index ba250fa471..4bd3ca9157 100644
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -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 )
diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h
index b1b39b637e..ea6f68c482 100644
--- a/indra/newview/llagent.h
+++ b/indra/newview/llagent.h
@@ -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?
diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp
index b89e1497a1..e930eb20d3 100644
--- a/indra/newview/llviewerkeyboard.cpp
+++ b/indra/newview/llviewerkeyboard.cpp
@@ -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);
}
}