update InsertCoin and InsertCredit functions

These should now agree with kyzentun's suggestions.
This commit is contained in:
Dan Guzek
2014-09-01 20:03:45 -04:00
parent eae5fcb3ba
commit 6ccbbb4f6f
2 changed files with 7 additions and 3 deletions
+6 -2
View File
@@ -2592,8 +2592,12 @@ public:
static int AddStageToPlayer( T* p, lua_State *L ) { p->AddStageToPlayer(Enum::Check<PlayerNumber>(L, 1)); return 0; }
static int InsertCoin( T* p, lua_State *L )
{
int numCoins = lua_tointeger(L, 1);
StepMania::InsertCoin(numCoins, false);
int numCoins = IArg(1);
if (GAMESTATE->m_iCoins + numCoins >= 0)
StepMania::InsertCoin(numCoins, false);
else
luaL_error( L, "Credits may not be negative." );
}
static int InsertCredit( T* p, lua_State *L )
{
+1 -1
View File
@@ -1252,7 +1252,7 @@ void StepMania::InsertCoin( int iNum, bool bCountInBookkeeping )
LOG->Trace("%i coins inserted, %i needed to play", GAMESTATE->m_iCoins.Get(), PREFSMAN->m_iCoinsPerCredit.Get() );
// If inserting coins, play the appropriate sound; if deducting coins, don't.
// If inserting coins, play an appropriate sound; if deducting coins, don't play anything.
if (iNum > 0)
{
if( iNumCoinsOld != GAMESTATE->m_iCoins )