From d2ee4ddb017b6d180a4ba7508905350491fcf603 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 7 Feb 2004 06:11:36 +0000 Subject: [PATCH] fix m_bAttackEndedThisUpdate being true when an attack begins fix course global mods tweening --- stepmania/src/GameState.cpp | 5 +++-- stepmania/src/ScreenGameplay.cpp | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index a721995e44..b7db723568 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -281,13 +281,14 @@ void GameState::Update( float fDelta ) { Attack &attack = m_ActiveAttacks[p][s]; const bool bCurrentlyEnabled = + attack.fStartSecond == -1 || (attack.fStartSecond < this->m_fMusicSeconds && - m_fMusicSeconds < attack.fStartSecond+attack.fSecsRemaining); + m_fMusicSeconds < attack.fStartSecond+attack.fSecsRemaining); if( m_ActiveAttacks[p][s].bOn == bCurrentlyEnabled ) continue; /* OK */ - if( !m_ActiveAttacks[p][s].bOn && bCurrentlyEnabled ) + if( m_ActiveAttacks[p][s].bOn && !bCurrentlyEnabled ) m_bAttackEndedThisUpdate[p] = true; bRebuildPlayerOptions = true; diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index 6930907492..b42dbb01d5 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -808,8 +808,10 @@ void ScreenGameplay::SetupSong( int p, int iSongIndex ) if( GAMESTATE->m_ActiveAttacks[p][s].fStartSecond == 0 ) GAMESTATE->m_ActiveAttacks[p][s].fStartSecond = -1; } + /* Update attack bOn flags. */ + GAMESTATE->Update(0); GAMESTATE->RebuildPlayerOptionsFromActiveAttacks( (PlayerNumber)p ); - + /* Snap. */ GAMESTATE->m_CurrentPlayerOptions[p] = GAMESTATE->m_PlayerOptions[p]; NoteData pOriginalNoteData;