From 168dc6ff922f5f6d29966fac126afdaa1086422d Mon Sep 17 00:00:00 2001 From: ehofman Date: Tue, 8 Dec 2009 09:53:29 +0000 Subject: [PATCH] if volume is too low, skip the function entirely --- src/ATCDCL/ATC.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ATCDCL/ATC.cxx b/src/ATCDCL/ATC.cxx index b4a17ae97..6bb6a2282 100644 --- a/src/ATCDCL/ATC.cxx +++ b/src/ATCDCL/ATC.cxx @@ -222,6 +222,8 @@ void FGATC::SetData(ATCData* d) { // The repeating flag indicates whether the message should be repeated continuously or played once. void FGATC::Render(string& msg, const float volume, const string& refname, const bool repeating) { + if (volume < 0.05) return; + if (repeating) fgSetString("/sim/messages/atis", msg.c_str()); else @@ -232,7 +234,7 @@ void FGATC::Render(string& msg, const float volume, if(_voice) { size_t len; void* buf = _vPtr->WriteMessage((char*)msg.c_str(), &len); - if(buf && (volume > 0.05)) { + if(buf) { NoRender(refname); try { // >>> Beware: must pass a (new) object to the (add) method, -- 2.39.5