From 674fc0ebc0e054f93f1c03b39911d7f7fe82db91 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Tue, 19 Apr 2005 22:31:35 +0000 Subject: [PATCH] fix bogus goal complete with GOAL_NONE --- stepmania/src/GameState.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index 95f45c11bc..d1e47c5a4e 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -1867,8 +1867,15 @@ float GameState::GetGoalPercentComplete( PlayerNumber pn ) fActual = ssAccum.fGameplaySeconds + ssCurrent.fGameplaySeconds; fGoal = (float)pProfile->m_iGoalSeconds; break; + case GOAL_NONE: + return 0; // never complete + default: + ASSERT(0); } - return fActual / fGoal; + if( fGoal == 0 ) + return 0; + else + return fActual / fGoal; } bool GameState::PlayerIsUsingModifier( PlayerNumber pn, const CString &sModifier )