From 2afa279d4c7780e4d43749d73891c9a7d46f4472 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Wed, 10 Feb 2021 17:53:49 -0500 Subject: Fixed running sound looping infinitely after running into map change --- src/character_system.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/character_system.cpp') diff --git a/src/character_system.cpp b/src/character_system.cpp index d4765bf..888914f 100644 --- a/src/character_system.cpp +++ b/src/character_system.cpp @@ -238,3 +238,11 @@ void CharacterSystem::stopRunningSound(Sprite& sprite) { sprite.runningSfxChannel = -1; } } + +void CharacterSystem::clearSpriteCache() { + for (Sprite& sprite : game_.getSprites() | game_.spriteView()) { + if (sprite.runningSfxChannel != -1) { + stopRunningSound(sprite); + } + } +} -- cgit 1.4.1