From 42d7a29ffa13bb6ee10b627deaed8f009b3f5968 Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Sun, 6 Nov 2011 22:15:54 -0600 Subject: [PATCH] [GameplayAssist] Don't play sounds if the player is dead. Fixes issue 621. --- Docs/Changelog_sm5.txt | 1 + src/GameplayAssist.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Docs/Changelog_sm5.txt b/Docs/Changelog_sm5.txt index 539774b567..f1f63d93e2 100644 --- a/Docs/Changelog_sm5.txt +++ b/Docs/Changelog_sm5.txt @@ -14,6 +14,7 @@ StepMania 5.0 $next | 2011xxxx refresh the NS data for the present game, not all games. [Wolfman2000] * [ScreenSelectMusic] Fixed Rave difficulties not being synced on late join. Fixes issue 577. [AJ] +* [GameplayAssist] Don't play sounds if the player is dead. Fixes issue 621. [AJ] 2011/11/04 * [ScoreKeeperRave] Revert fix from 2011/10/28. [AJ] diff --git a/src/GameplayAssist.cpp b/src/GameplayAssist.cpp index e42920f15c..66fe7398c9 100644 --- a/src/GameplayAssist.cpp +++ b/src/GameplayAssist.cpp @@ -21,14 +21,17 @@ void GameplayAssist::PlayTicks( const NoteData &nd, const PlayerState *ps ) if( !bClap && !bMetronome ) return; + // don't play sounds for dead players + if( ps->m_HealthState == HealthState_Dead ) + return; + /* Sound cards have a latency between when a sample is Play()ed and when the sound * will start coming out the speaker. Compensate for this by boosting fPositionSeconds * ahead. This is just to make sure that we request the sound early enough for it to * come out on time; the actual precise timing is handled by SetStartTime. */ - SongPosition &position = GAMESTATE->m_pPlayerState[ps->m_PlayerNumber]->m_Position; float fPositionSeconds = position.m_fMusicSeconds; - + //float fPositionSeconds = GAMESTATE->m_Position.m_fMusicSeconds; fPositionSeconds += SOUNDMAN->GetPlayLatency() + (float)CommonMetrics::TICK_EARLY_SECONDS + 0.250f; const TimingData &timing = GAMESTATE->m_pCurSteps[ps->m_PlayerNumber]->m_Timing;