CoinMode_Pay->CoinMode_Free, step 1.

CoinMode_Pay is still a value for the CoinMode enum but is now the same as CoinMode_Free.
Any code that checks for CoinMode_Pay is gone.
This commit is contained in:
Flameshadowxeroshin
2013-02-07 09:12:28 -06:00
parent 4f7f4f4a51
commit 15b3ee1a9a
8 changed files with 7 additions and 113 deletions
-57
View File
@@ -493,50 +493,6 @@ bool GameCommand::IsPlayable( RString *why ) const
if ( m_pStyle )
{
int iCredits = GAMESTATE->m_iCoins / PREFSMAN->m_iCoinsPerCredit;
const int iNumCreditsPaid = GetNumCreditsPaid();
const int iNumCreditsRequired = GetCreditsRequiredToPlayStyle(m_pStyle);
switch( GAMESTATE->GetCoinMode() )
{
case CoinMode_Home:
case CoinMode_Free:
iCredits = NUM_PLAYERS; // not iNumCreditsPaid
default: break;
}
/* With PREFSMAN->m_bDelayedCreditsReconcile disabled, enough credits must
* be paid. (This means that enough sides must be joined.) Enabled, simply
* having enough credits lying in the machine is sufficient; we'll deduct the
* extra in Apply(). */
int iNumCreditsAvailable = iNumCreditsPaid;
if( PREFSMAN->m_bDelayedCreditsReconcile )
iNumCreditsAvailable += iCredits;
if( iNumCreditsAvailable < iNumCreditsRequired )
{
if( why )
*why = ssprintf( "need %i credits, have %i", iNumCreditsRequired, iNumCreditsAvailable );
return false;
}
/* If you've paid too much already, don't allow the mode. (If we allow this,
* the credits will be "refunded" in Apply(), but that's confusing.) */
/* Do allow the mode if they've already joined in more credits than
* are required. Otherwise, people who put in two credits to play
* doubles on a doubles-premium machiune will get locked out.
* the refund logic isn't that awkward because you never see the
* credits number jump up - the credits display is hidden if both
* sides are joined. -Chris */
/*
if( PREFSMAN->m_iCoinMode == COIN_PAY && iNumCreditsPaid > iNumCreditsRequired )
{
if( why )
*why = ssprintf( "too many credits paid (%i > %i)", iNumCreditsPaid, iNumCreditsRequired );
return false;
}
*/
/* If both sides are joined, disallow singles modes, since easy to select
* them accidentally, instead of versus mode. */
if( m_pStyle->m_StyleType == StyleType_OnePlayerOneSide &&
@@ -662,19 +618,6 @@ void GameCommand::ApplySelf( const vector<PlayerNumber> &vpns ) const
{
GAMESTATE->SetCurrentStyle( m_pStyle );
// It's possible to choose a style that didn't have enough players joined.
// If enough players aren't joined, then we need to subtract credits
// for the sides that will be joined as a result of applying this option.
if( GAMESTATE->GetCoinMode() == CoinMode_Pay )
{
int iNumCreditsRequired = GetCreditsRequiredToPlayStyle(m_pStyle);
int iNumCreditsPaid = GetNumCreditsPaid();
int iNumCreditsOwed = iNumCreditsRequired - iNumCreditsPaid;
GAMESTATE->m_iCoins.Set( GAMESTATE->m_iCoins - iNumCreditsOwed * PREFSMAN->m_iCoinsPerCredit );
LOG->Trace( "Deducted %i coins, %i remaining",
iNumCreditsOwed * PREFSMAN->m_iCoinsPerCredit, GAMESTATE->m_iCoins.Get() );
}
// If only one side is joined and we picked a style that requires both
// sides, join the other side.
switch( m_pStyle->m_StyleType )