From ab794ffb2df494cc745c92d94cf440c50c2322e8 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sun, 5 Jun 2005 03:16:57 +0000 Subject: [PATCH] don't allow multiple changes on the same beat --- stepmania/src/Song.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index 9448d4d110..7eef0d44c8 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -106,6 +106,16 @@ void Song::Reset() void Song::AddBackgroundChange( BackgroundLayer iLayer, BackgroundChange seg ) { + // Delete old background change at this start beat, if any. + FOREACH( BackgroundChange, GetBackgroundChanges(iLayer), bgc ) + { + if( bgc->m_fStartBeat == seg.m_fStartBeat ) + { + GetBackgroundChanges(iLayer).erase( bgc ); + break; + } + } + ASSERT( iLayer >= 0 && iLayer < NUM_BackgroundLayer ); GetBackgroundChanges(iLayer).push_back( seg ); BackgroundUtil::SortBackgroundChangesArray( GetBackgroundChanges(iLayer) );