From 2f04a1fe2955c482184dcdbb2169bf7c7ad2a586 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 25 Feb 2007 08:51:41 +0000 Subject: [PATCH] HealthStateChanged --- stepmania/src/ScreenGameplay.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index cc8e4577c3..935e168d0d 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -1531,6 +1531,7 @@ void ScreenGameplay::Update( float fDeltaTime ) FOREACH_EnabledPlayerInfo( m_vPlayerInfo, pi ) { HealthState &hs = pi->GetPlayerState()->m_HealthState; + HealthState OldHealthState = hs; if( GAMESTATE->GetPlayerFailType(pi->GetPlayerState()) != SongOptions::FAIL_OFF && pi->m_pLifeMeter && pi->m_pLifeMeter->IsFailing() ) { @@ -1549,6 +1550,14 @@ void ScreenGameplay::Update( float fDeltaTime ) { hs = HealthState_Alive; } + + if( hs != OldHealthState ) + { + Message msg( "HealthStateChanged" ); + msg.SetParam( "PlayerNumber", pi->m_pn ); + msg.SetParam( "HealthState", hs ); + MESSAGEMAN->Broadcast( msg ); + } pi->m_SoundEffectControl.Update( fDeltaTime ); }