From 91b2a2224b5800095efa078d656d6d71bf7674df Mon Sep 17 00:00:00 2001 From: Flameshadowxeroshin Date: Sat, 25 Sep 2010 09:50:56 -0500 Subject: [PATCH] re-implement SetScore, probably successfully this time --- src/PlayerStageStats.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/PlayerStageStats.cpp b/src/PlayerStageStats.cpp index 9beea318e1..3f472a0dea 100644 --- a/src/PlayerStageStats.cpp +++ b/src/PlayerStageStats.cpp @@ -262,6 +262,7 @@ float PlayerStageStats::GetCurMaxPercentDancePoints() const if ( m_iPossibleDancePoints == 0 ) + return 0; // div/0 if ( m_iCurPossibleDancePoints == m_iPossibleDancePoints ) @@ -724,6 +725,7 @@ public: static int GetRadarPossible( T* p, lua_State *L ) { p->m_radarPossible.PushSelf(L); return 1; } static int GetRadarActual( T* p, lua_State *L ) { p->m_radarActual.PushSelf(L); return 1; } + static int SetScore( T* p, lua_State *L ) { if( IArg(1) >= 0 ){ p->m_iScore = IArg(1); return 1; } return 0; } LunaPlayerStageStats() { @@ -759,6 +761,7 @@ public: ADD_METHOD( GetRadarActual ); ADD_METHOD( GetRadarPossible ); ADD_METHOD( GetBestFullComboTapNoteScore ); + ADD_METHOD( SetScore ); } };