fix: Clean up LastAudio when Sound is removed, not Source.

This commit is contained in:
Nolan Darilek 2023-10-16 07:25:36 -05:00
parent 53891eeaa8
commit 1fb0aa763a

View File

@ -590,7 +590,7 @@ fn update_sound_playback_state(query: Query<&Sound>) {
}
}
fn remove_sound(mut last_buffer: ResMut<LastAudio>, mut removed: RemovedComponents<Source>) {
fn remove_sound(mut last_buffer: ResMut<LastAudio>, mut removed: RemovedComponents<Sound>) {
for entity in removed.iter() {
last_buffer.remove(&entity);
}