Implemented SetActualDancePoints & SetPossibleDancePoints (#1527)
* Implemented Dance Point setting Methods added: SetPossibleDancePoints SetActualDancePoints * Update luadocs to reflect changes * Fix possible divide by zero * Merge DP setting functions into one. (#5) * Merge DP setting functions into one. Also, ensure that scores of >100% aren't possible Function usage: SetDancePointLimits(actual, possible) Clamps to 100% if actual/possible >100% * Update the luadocs again
This commit is contained in:
@@ -865,6 +865,25 @@ public:
|
||||
}
|
||||
COMMON_RETURN_SELF;
|
||||
}
|
||||
static int SetDancePointLimits( T* p, lua_State *L )
|
||||
{
|
||||
int actual = IArg(1);
|
||||
int possible = IArg(2);
|
||||
if( actual >= 0 && possible > 0 )
|
||||
{
|
||||
p->m_iPossibleDancePoints = possible;
|
||||
if( actual <= possible )
|
||||
{
|
||||
p->m_iActualDancePoints = actual;
|
||||
}
|
||||
else
|
||||
{
|
||||
p->m_iActualDancePoints = possible;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
COMMON_RETURN_SELF;
|
||||
}
|
||||
|
||||
static int FailPlayer( T* p, lua_State *L )
|
||||
{
|
||||
@@ -915,6 +934,7 @@ public:
|
||||
ADD_METHOD( SetScore );
|
||||
ADD_METHOD( GetCurMaxScore );
|
||||
ADD_METHOD( SetCurMaxScore );
|
||||
ADD_METHOD( SetDancePointLimits );
|
||||
ADD_METHOD( FailPlayer );
|
||||
ADD_METHOD( GetSongsPassed );
|
||||
ADD_METHOD( GetSongsPlayed );
|
||||
|
||||
Reference in New Issue
Block a user