From ef21deb6614aee1b470dff0217be7323f5b38be9 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Fri, 22 Apr 2005 05:15:10 +0000 Subject: [PATCH] assert on invalid attack ranges at load time so they don't slip to play time --- stepmania/src/Attack.cpp | 1 + stepmania/src/Course.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/stepmania/src/Attack.cpp b/stepmania/src/Attack.cpp index 5019b76fe5..2f26ecafa2 100644 --- a/stepmania/src/Attack.cpp +++ b/stepmania/src/Attack.cpp @@ -32,6 +32,7 @@ void Attack::GetAttackBeats( const Song *song, const PlayerState* pPlayerState, GAMESTATE->GetUndisplayedBeats( pPlayerState, fSecsRemaining, fStartBeat, fEndBeat ); } + // loading the course should have caught this. ASSERT_M( fEndBeat >= fStartBeat, ssprintf("%f >= %f", fEndBeat, fStartBeat) ); } diff --git a/stepmania/src/Course.cpp b/stepmania/src/Course.cpp index 34c2f8115a..4f52f718da 100644 --- a/stepmania/src/Course.cpp +++ b/stepmania/src/Course.cpp @@ -177,6 +177,7 @@ void Course::LoadFromCRSFile( CString sPath ) { if( end != -9999 ) { + ASSERT_M( end >= attack.fStartSecond, ssprintf("Attack ends before it starts. end %f, start %f", end, attack.fStartSecond) ); attack.fSecsRemaining = end - attack.fStartSecond; end = -9999; }