sounds variability + first step fix
This commit is contained in:
@@ -249,6 +249,12 @@ speakerid_t audio::play(
|
||||
int priority,
|
||||
int channel
|
||||
) {
|
||||
if (!sound->variants.empty()) {
|
||||
size_t index = rand() % (sound->variants.size() + 1);
|
||||
if (index < sound->variants.size()) {
|
||||
sound = sound->variants.at(index).get();
|
||||
}
|
||||
}
|
||||
Speaker* speaker = sound->newInstance(priority, channel);
|
||||
if (speaker == nullptr) {
|
||||
remove_lower_priority_speaker(priority);
|
||||
|
||||
Reference in New Issue
Block a user