From d2fa9e26a00632dede64d13d8be643880bdeb348 Mon Sep 17 00:00:00 2001 From: ThorstenB Date: Sat, 12 May 2012 16:05:35 +0200 Subject: [PATCH] #767: stop ATIS when switching off volume or loosing station --- src/ATCDCL/ATC.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ATCDCL/ATC.cxx b/src/ATCDCL/ATC.cxx index 776ec3441..2653d442f 100644 --- a/src/ATCDCL/ATC.cxx +++ b/src/ATCDCL/ATC.cxx @@ -203,7 +203,11 @@ void FGATC::SetStation(flightgear::CommStation* sta) { // 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 (volume < 0.05) + { + NoRender(refname); + return; + } if (repeating) fgSetString("/sim/messages/atis", msg.c_str()); @@ -215,8 +219,8 @@ void FGATC::Render(string& msg, const float volume, if(_voice) { size_t len; void* buf = _vPtr->WriteMessage((char*)msg.c_str(), &len); + NoRender(refname); if(buf) { - NoRender(refname); try { // >>> Beware: must pass a (new) object to the (add) method, // >>> because the (remove) method is going to do a (delete) -- 2.39.5