1
0
Fork 0

play-audio-sample command: check path

Don't try to play missing paths.
This commit is contained in:
James Turner 2021-07-27 14:22:04 +01:00
parent 383fb2a5d1
commit 8853fded29

View file

@ -212,6 +212,13 @@ bool FGSoundManager::playAudioSampleCommand(const SGPropertyNode * arg, SGProper
string path = arg->getStringValue("path"); string path = arg->getStringValue("path");
string file = arg->getStringValue("file"); string file = arg->getStringValue("file");
float volume = arg->getFloatValue("volume"); float volume = arg->getFloatValue("volume");
SGPath foundPath = globals->resolve_maybe_aircraft_path(path);
if (!foundPath.exists()) {
SG_LOG(SG_GENERAL, SG_ALERT, "play-audio-sample: no such file:'" << path << "'");
return false;
}
// cout << "playing " << path << " / " << file << endl; // cout << "playing " << path << " / " << file << endl;
try { try {
if ( !_queue[name] ) { if ( !_queue[name] ) {