fix non-localOnly positional sounds not updating

This commit is contained in:
HifiExperiments 2024-07-19 17:31:51 -07:00
parent 0e4e8d2f9d
commit 9d2e03a5a4
2 changed files with 6 additions and 5 deletions

View file

@ -62,7 +62,7 @@ void SimpleEntitySimulation::addEntityToInternalLists(EntityItemPointer entity)
// we don't allow dynamic objects to move without an owner so nothing to do here
} else if (entity->isMovingRelativeToParent()) {
SetOfEntities::iterator itr = _simpleKinematicEntities.find(entity);
if (itr != _simpleKinematicEntities.end()) {
if (itr == _simpleKinematicEntities.end()) {
_simpleKinematicEntities.insert(entity);
entity->setLastSimulated(usecTimestampNow());
}
@ -73,7 +73,7 @@ void SimpleEntitySimulation::addEntityToInternalLists(EntityItemPointer entity)
if (entity->isMovingRelativeToParent()) {
SetOfEntities::iterator itr = _simpleKinematicEntities.find(entity);
if (itr != _simpleKinematicEntities.end()) {
if (itr == _simpleKinematicEntities.end()) {
_simpleKinematicEntities.insert(entity);
entity->setLastSimulated(usecTimestampNow());
}

View file

@ -359,8 +359,8 @@ void SoundEntityItem::setLocalOnly(bool value) {
if (_injector) {
DependencyManager::get<AudioInjectorManager>()->stop(_injector);
_injector = nullptr;
}
_injector = nullptr;
}
if (_sound) {
@ -409,7 +409,7 @@ bool SoundEntityItem::restartSound(bool lock) {
options.ambisonic = _sound->isAmbisonic();
if (_injector) {
DependencyManager::get<AudioInjectorManager>()->setOptionsAndRestart(_injector, options);
DependencyManager::get<AudioInjectorManager>()->setOptions(_injector, options);
} else {
_injector = DependencyManager::get<AudioInjectorManager>()->playSound(_sound, options);
}
@ -431,8 +431,8 @@ void SoundEntityItem::updateSound(bool restart) {
if (restart) {
if (_injector) {
DependencyManager::get<AudioInjectorManager>()->stop(_injector);
_injector = nullptr;
}
_injector = nullptr;
}
if (_playing) {
@ -440,6 +440,7 @@ void SoundEntityItem::updateSound(bool restart) {
} else {
if (_injector) {
DependencyManager::get<AudioInjectorManager>()->stop(_injector);
_injector = nullptr;
}
}
}