if volume is too low, skip the function entirely
This commit is contained in:
parent
0dc35c8d38
commit
168dc6ff92
1 changed files with 3 additions and 1 deletions
|
@ -222,6 +222,8 @@ void FGATC::SetData(ATCData* d) {
|
||||||
// The repeating flag indicates whether the message should be repeated continuously or played once.
|
// The repeating flag indicates whether the message should be repeated continuously or played once.
|
||||||
void FGATC::Render(string& msg, const float volume,
|
void FGATC::Render(string& msg, const float volume,
|
||||||
const string& refname, const bool repeating) {
|
const string& refname, const bool repeating) {
|
||||||
|
if (volume < 0.05) return;
|
||||||
|
|
||||||
if (repeating)
|
if (repeating)
|
||||||
fgSetString("/sim/messages/atis", msg.c_str());
|
fgSetString("/sim/messages/atis", msg.c_str());
|
||||||
else
|
else
|
||||||
|
@ -232,7 +234,7 @@ void FGATC::Render(string& msg, const float volume,
|
||||||
if(_voice) {
|
if(_voice) {
|
||||||
size_t len;
|
size_t len;
|
||||||
void* buf = _vPtr->WriteMessage((char*)msg.c_str(), &len);
|
void* buf = _vPtr->WriteMessage((char*)msg.c_str(), &len);
|
||||||
if(buf && (volume > 0.05)) {
|
if(buf) {
|
||||||
NoRender(refname);
|
NoRender(refname);
|
||||||
try {
|
try {
|
||||||
// >>> Beware: must pass a (new) object to the (add) method,
|
// >>> Beware: must pass a (new) object to the (add) method,
|
||||||
|
|
Loading…
Add table
Reference in a new issue