diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-12-10 18:57:03 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-12-10 18:57:03 +0100 |
commit | 7cbc577e94ed048f2a8146fab6972ae6ff290be7 (patch) | |
tree | bd0d3df10e494bbf05fec8d6ac1b64d5fba27087 /src/crepe/system/AudioSystem.cpp | |
parent | fe865eef33eb78b6dab6a177b463554f2ffe7387 (diff) |
fix AudioSystem bug + add regression testloek/audio
Diffstat (limited to 'src/crepe/system/AudioSystem.cpp')
-rw-r--r-- | src/crepe/system/AudioSystem.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/crepe/system/AudioSystem.cpp b/src/crepe/system/AudioSystem.cpp index b2c1dc6..ddba268 100644 --- a/src/crepe/system/AudioSystem.cpp +++ b/src/crepe/system/AudioSystem.cpp @@ -26,12 +26,12 @@ void AudioSystem::diff_update(AudioSource & component, Sound & resource) { SoundContext & context = this->get_context(); if (component.active != component.last_active) { - if (component.active) { - component.oneshot_play = component.play_on_awake; - } else { + if (!component.active) { context.stop(component.voice); return; } + if (component.play_on_awake) + component.oneshot_play = true; } if (!component.active) return; |