Permalink
Browse files

Fix to audio cue bug courtesy of Trent G

  • Loading branch information...
1 parent 8baa5a6 commit fcba725b817531c258719915ff70e6dbb0883121 @Cheeseness committed Dec 9, 2012
Showing with 10 additions and 4 deletions.
  1. +10 −4 src/AudioManager.cpp
View
@@ -79,10 +79,16 @@ void AudioManager::stopAudio()
void AudioManager::setAudioCue(ALLEGRO_SAMPLE* newCue)
{
- static bool first = true;
- if (!first)
- first = false, al_stop_sample(currentSample);
- al_play_sample(newCue, 0.7f, 0.0f, 1.0f, ALLEGRO_PLAYMODE_LOOP, currentSample);
+ static bool first = true;
+ if (!first)
+ {
+ al_stop_sample(currentSample);
+ {
+ else
+ {
+ first = false;
+ }
+ al_play_sample(newCue, 0.7f, 0.0f, 1.0f, ALLEGRO_PLAYMODE_LOOP, currentSample);
}
AudioManager::~AudioManager()

0 comments on commit fcba725

Please sign in to comment.