mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
help to non-existing command + audio fix
This commit is contained in:
parent
56ab8c5c84
commit
2809cc9b86
2 changed files with 9 additions and 5 deletions
|
|
@ -255,16 +255,17 @@ speakerid_t audio::play(
|
|||
sound = sound->variants.at(index).get();
|
||||
}
|
||||
}
|
||||
auto speaker = sound->newInstance(priority, channel);
|
||||
if (speaker == nullptr) {
|
||||
auto speaker_ptr = sound->newInstance(priority, channel);
|
||||
if (speaker_ptr == nullptr) {
|
||||
remove_lower_priority_speaker(priority);
|
||||
speaker = sound->newInstance(priority, channel);
|
||||
speaker_ptr = sound->newInstance(priority, channel);
|
||||
}
|
||||
if (speaker == nullptr) {
|
||||
if (speaker_ptr == nullptr) {
|
||||
return 0;
|
||||
}
|
||||
auto speaker = speaker_ptr.get();
|
||||
speakerid_t id = nextId++;
|
||||
speakers.emplace(id, std::move(speaker));
|
||||
speakers.emplace(id, std::move(speaker_ptr));
|
||||
speaker->setPosition(position);
|
||||
speaker->setVolume(volume);
|
||||
speaker->setPitch(pitch);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue