From a617dbdf2cf178ed3fec4ef1de1f988ff21bddfd Mon Sep 17 00:00:00 2001 From: Flameshadowxeroshin Date: Fri, 24 Sep 2010 22:43:07 -0500 Subject: [PATCH] Add SetScore Lua binding to PlayerStageStats. --- src/PlayerStageStats.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/PlayerStageStats.cpp b/src/PlayerStageStats.cpp index 58cfe3a273..dfca489c38 100644 --- a/src/PlayerStageStats.cpp +++ b/src/PlayerStageStats.cpp @@ -261,6 +261,7 @@ float PlayerStageStats::GetCurMaxPercentDancePoints() const { if ( m_iPossibleDancePoints == 0 ) + return 0; // div/0 if ( m_iCurPossibleDancePoints == m_iPossibleDancePoints ) @@ -720,6 +721,16 @@ public: } return 1; } + static int SetScore(T* p, lua_State *L ) + { + int newScore = lua_tonumber(1, L); + if( newScore >= 0) + { + p->m_iScore = newScore; + return 1; + } + return 0; + } 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; }