diff --git a/src/Foreground.cpp b/src/Foreground.cpp index fdfed2a955..a917f41e76 100644 --- a/src/Foreground.cpp +++ b/src/Foreground.cpp @@ -120,6 +120,17 @@ void Foreground::Update( float fDeltaTime ) m_fLastMusicSeconds = GAMESTATE->m_Position.m_fMusicSeconds; } +void Foreground::HandleMessage( const Message &msg ) +{ + // We want foregrounds to behave as if their On command happens at the + // starting beat, not when the Foreground object receives an On command. + // So don't propagate that; we'll call it ourselves. + if (msg.GetName() == "On") + Actor::HandleMessage(msg); + else + ActorFrame::HandleMessage(msg); +} + /* * (c) 2004 Glenn Maynard * All rights reserved. diff --git a/src/Foreground.h b/src/Foreground.h index 51a0b225fb..e49ba1267a 100644 --- a/src/Foreground.h +++ b/src/Foreground.h @@ -13,6 +13,7 @@ public: void LoadFromSong( const Song *pSong ); virtual void Update( float fDeltaTime ); + virtual void HandleMessage( const Message &msg ); protected: struct LoadedBGA