Skip to content

Commit

Permalink
fix(audio): Don't pause sound effects when audio is already paused (e…
Browse files Browse the repository at this point in the history
  • Loading branch information
tibetiroka authored Jan 25, 2025
1 parent 613aa38 commit 30cefd0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions source/PlanetPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ PlanetPanel::PlanetPanel(PlayerInfo &player, function<void()> callback)
GameData::Preload(queue, planet.Landscape());
queue.Wait();
queue.ProcessSyncTasks();

Audio::Pause();
}


Expand Down
4 changes: 3 additions & 1 deletion source/audio/Audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,9 @@ void Audio::Step(bool isFastForward)

if(pauseChangeCount > 0)
{
if(pauseCount += pauseChangeCount)
bool wasPaused = pauseCount;
pauseCount += pauseChangeCount;
if(pauseCount && !wasPaused)
{
ALint state;
for(const Source &source : sources)
Expand Down

0 comments on commit 30cefd0

Please sign in to comment.