diff --git a/src/PlayerStageStats.cpp b/src/PlayerStageStats.cpp index 3f472a0dea..69a4dbe3b7 100644 --- a/src/PlayerStageStats.cpp +++ b/src/PlayerStageStats.cpp @@ -13,6 +13,7 @@ #include "CommonMetrics.h" #define GRADE_PERCENT_TIER(i) THEME->GetMetricF("PlayerStageStats",ssprintf("GradePercent%s",GradeToString((Grade)i).c_str())) +// deprecated, but no solution to replace them exists yet: #define GRADE_TIER02_IS_ALL_W2S THEME->GetMetricB("PlayerStageStats","GradeTier02IsAllW2s") #define GRADE_TIER01_IS_ALL_W2S THEME->GetMetricB("PlayerStageStats","GradeTier01IsAllW2s") #define GRADE_TIER02_IS_FULL_COMBO THEME->GetMetricB("PlayerStageStats","GradeTier02IsFullCombo") @@ -76,7 +77,7 @@ void PlayerStageStats::AddStats( const PlayerStageStats& other ) m_iActualDancePoints += other.m_iActualDancePoints; m_iCurPossibleDancePoints += other.m_iCurPossibleDancePoints; m_iPossibleGradePoints += other.m_iPossibleGradePoints; - + for( int t=0; tTrace( "GetGrade: fActual: %f, fPossible: %d", fActual, m_iPossibleGradePoints ); - float fPercent = (m_iPossibleGradePoints == 0) ? 0 : fActual / m_iPossibleGradePoints; Grade grade = GetGradeFromPercent( fPercent ); //LOG->Trace( "GetGrade: Grade: %s, %i", GradeToString(grade).c_str(), GRADE_TIER02_IS_ALL_W2S ); + + // todo: move all these conditions to Lua. -aj if( GRADE_TIER02_IS_ALL_W2S ) { if( FullComboOfScore(TNS_W1) ) @@ -260,9 +262,6 @@ float PlayerStageStats::GetPercentDancePoints() const float PlayerStageStats::GetCurMaxPercentDancePoints() const { if ( m_iPossibleDancePoints == 0 ) - - - return 0; // div/0 if ( m_iCurPossibleDancePoints == m_iPossibleDancePoints ) @@ -403,14 +402,13 @@ float PlayerStageStats::GetLifeRecordLerpAt( float fStepsSecond ) const if( later == m_fLifeRecord.end() ) return earlier->second; - if( earlier->first == later->first ) // two samples from the same time. Don't divide by zero in SCALE + if( earlier->first == later->first ) // two samples from the same time. Don't divide by zero in SCALE return earlier->second; // earlier <= pos <= later return SCALE( fStepsSecond, earlier->first, later->first, earlier->second, later->second ); } - void PlayerStageStats::GetLifeRecord( float *fLifeOut, int iNumSamples, float fStepsEndSecond ) const { for( int i = 0; i < iNumSamples; ++i ) @@ -768,7 +766,6 @@ public: LUA_REGISTER_CLASS( PlayerStageStats ) // lua end - /* * (c) 2001-2004 Chris Danford, Glenn Maynard * All rights reserved. diff --git a/src/PlayerStageStats.h b/src/PlayerStageStats.h index 59f487e8f6..373911e6b1 100644 --- a/src/PlayerStageStats.h +++ b/src/PlayerStageStats.h @@ -123,7 +123,6 @@ public: void PushSelf( lua_State *L ); }; - #endif /*