touch up style to InsertCredit and InsertCoin
Third time's the charm.
This commit is contained in:
+6
-2
@@ -2594,14 +2594,18 @@ public:
|
|||||||
{
|
{
|
||||||
int numCoins = IArg(1);
|
int numCoins = IArg(1);
|
||||||
if (GAMESTATE->m_iCoins + numCoins >= 0)
|
if (GAMESTATE->m_iCoins + numCoins >= 0)
|
||||||
|
{
|
||||||
StepMania::InsertCoin(numCoins, false);
|
StepMania::InsertCoin(numCoins, false);
|
||||||
else
|
} else {
|
||||||
|
// Warn themers if they attempt to set credits to a negative value.
|
||||||
luaL_error( L, "Credits may not be negative." );
|
luaL_error( L, "Credits may not be negative." );
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
static int InsertCredit( T* p, lua_State *L )
|
static int InsertCredit( T* p, lua_State *L )
|
||||||
{
|
{
|
||||||
StepMania::InsertCredit();
|
StepMania::InsertCredit();
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
static int CurrentOptionsDisqualifyPlayer( T* p, lua_State *L ) { lua_pushboolean(L, p->CurrentOptionsDisqualifyPlayer(Enum::Check<PlayerNumber>(L, 1))); return 1; }
|
static int CurrentOptionsDisqualifyPlayer( T* p, lua_State *L ) { lua_pushboolean(L, p->CurrentOptionsDisqualifyPlayer(Enum::Check<PlayerNumber>(L, 1))); return 1; }
|
||||||
|
|
||||||
|
|||||||
+7
-1
@@ -1243,12 +1243,16 @@ void StepMania::InsertCoin( int iNum, bool bCountInBookkeeping )
|
|||||||
|
|
||||||
// Don't allow GAMESTATE's coin count to become negative.
|
// Don't allow GAMESTATE's coin count to become negative.
|
||||||
if (GAMESTATE->m_iCoins + iNum >= 0)
|
if (GAMESTATE->m_iCoins + iNum >= 0)
|
||||||
|
{
|
||||||
GAMESTATE->m_iCoins.Set( GAMESTATE->m_iCoins + iNum );
|
GAMESTATE->m_iCoins.Set( GAMESTATE->m_iCoins + iNum );
|
||||||
|
}
|
||||||
|
|
||||||
int iCredits = GAMESTATE->m_iCoins / PREFSMAN->m_iCoinsPerCredit;
|
int iCredits = GAMESTATE->m_iCoins / PREFSMAN->m_iCoinsPerCredit;
|
||||||
bool bMaxCredits = iCredits >= MAX_NUM_CREDITS;
|
bool bMaxCredits = iCredits >= MAX_NUM_CREDITS;
|
||||||
if( bMaxCredits )
|
if( bMaxCredits )
|
||||||
|
{
|
||||||
GAMESTATE->m_iCoins.Set( MAX_NUM_CREDITS * PREFSMAN->m_iCoinsPerCredit );
|
GAMESTATE->m_iCoins.Set( MAX_NUM_CREDITS * PREFSMAN->m_iCoinsPerCredit );
|
||||||
|
}
|
||||||
|
|
||||||
LOG->Trace("%i coins inserted, %i needed to play", GAMESTATE->m_iCoins.Get(), PREFSMAN->m_iCoinsPerCredit.Get() );
|
LOG->Trace("%i coins inserted, %i needed to play", GAMESTATE->m_iCoins.Get(), PREFSMAN->m_iCoinsPerCredit.Get() );
|
||||||
|
|
||||||
@@ -1256,10 +1260,12 @@ void StepMania::InsertCoin( int iNum, bool bCountInBookkeeping )
|
|||||||
if (iNum > 0)
|
if (iNum > 0)
|
||||||
{
|
{
|
||||||
if( iNumCoinsOld != GAMESTATE->m_iCoins )
|
if( iNumCoinsOld != GAMESTATE->m_iCoins )
|
||||||
|
{
|
||||||
SCREENMAN->PlayCoinSound();
|
SCREENMAN->PlayCoinSound();
|
||||||
else
|
} else {
|
||||||
SCREENMAN->PlayInvalidSound();
|
SCREENMAN->PlayInvalidSound();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* If AutoJoin and a player is already joined, then try to join a player.
|
/* If AutoJoin and a player is already joined, then try to join a player.
|
||||||
* (If no players are joined, they'll join on the first JoinInput.) */
|
* (If no players are joined, they'll join on the first JoinInput.) */
|
||||||
|
|||||||
Reference in New Issue
Block a user