play-audio-sample command: check path
Don't try to play missing paths.
This commit is contained in:
parent
383fb2a5d1
commit
8853fded29
1 changed files with 7 additions and 0 deletions
|
@ -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] ) {
|
||||||
|
|
Loading…
Reference in a new issue