From 1c28a06bb606df04dcdb737ca023f5cf20e6eb09 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Tue, 1 Nov 2011 15:20:20 -0400 Subject: [PATCH] Fix Expand, possibly other mods, for 2nd player. --- Docs/Changelog_sm5.txt | 5 +++++ src/ArrowEffects.cpp | 15 +++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Docs/Changelog_sm5.txt b/Docs/Changelog_sm5.txt index 0d288eed41..739abff5f9 100644 --- a/Docs/Changelog_sm5.txt +++ b/Docs/Changelog_sm5.txt @@ -8,6 +8,11 @@ ________________________________________________________________________________ StepMania 5.0 $next | 2011xxxx -------------------------------------------------------------------------------- +2011/11/01 +---------- +* [ArrowEffects] Fix Expand, and possibly other mods, from breaking if + using a second player. [Wolfman2000] + 2011/10/29 ---------- * [GameState] Add the ResetPlayerOptions lua binding. [Wolfman2000] diff --git a/src/ArrowEffects.cpp b/src/ArrowEffects.cpp index 3c2bdd5f4c..1fd584b61b 100644 --- a/src/ArrowEffects.cpp +++ b/src/ArrowEffects.cpp @@ -84,6 +84,9 @@ void ArrowEffects::Update() { const Style* pStyle = GAMESTATE->GetCurrentStyle(); + static float fLastTime = 0; + float fTime = RageTimer::GetTimeSinceStartFast(); + FOREACH_PlayerNumber( pn ) { const Style::ColumnInfo* pCols = pStyle->m_ColumnInfo[pn]; @@ -92,15 +95,10 @@ void ArrowEffects::Update() PerPlayerData &data = g_EffectData[pn]; + if( !position.m_bFreeze || !position.m_bDelay ) { - static float fLastTime = 0; - float fTime = RageTimer::GetTimeSinceStartFast(); - if( !position.m_bFreeze || !position.m_bDelay ) - { - data.m_fExpandSeconds += fTime - fLastTime; - data.m_fExpandSeconds = fmodf( data.m_fExpandSeconds, PI*2 ); - } - fLastTime = fTime; + data.m_fExpandSeconds += fTime - fLastTime; + data.m_fExpandSeconds = fmodf( data.m_fExpandSeconds, PI*2 ); } // Update Tornado @@ -211,6 +209,7 @@ void ArrowEffects::Update() data.m_fBeatFactor *= 20.0f; } while( false ); } + fLastTime = fTime; } static float GetDisplayedBeat( const PlayerState* pPlayerState, float beat )