From d83e8ec60c869e529db9f4b226698825a764d51b Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sun, 20 Mar 2005 20:37:24 +0000 Subject: [PATCH] warn instead of asserting on tween overflow --- stepmania/src/Actor.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/stepmania/src/Actor.cpp b/stepmania/src/Actor.cpp index e4710a11da..2134893f16 100644 --- a/stepmania/src/Actor.cpp +++ b/stepmania/src/Actor.cpp @@ -466,7 +466,15 @@ void Actor::BeginTweening( float time, TweenType tt ) time = max( time, 0 ); - DEBUG_ASSERT( m_Tweens.size() < 50 ); // there's no reason for the number of tweens to ever go this large + // If the number of tweens to ever gets this large, there's probably an infinitely + // recursing ActorCommand. + if( m_Tweens.size() > 50 ) + { + CString sError = ssprintf( "Tween overflow: size = %u. infinitely recursing ActorCommand?", m_Tweens.size() ); + LOG->Warn( sError ); + Dialog::OK( sError ); + FinishTweening(); + } // add a new TweenState to the tail, and initialize it m_Tweens.resize( m_Tweens.size()+1 );