From c00ba374d1614093e50cb4fcd249a3d07e9c189a Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 31 May 2004 01:03:45 +0000 Subject: [PATCH] add assert --- stepmania/src/Player.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index 90b0f295bd..fbaeef129e 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -305,15 +305,17 @@ void PlayerMinus::Update( float fDeltaTime ) // // update pressed flag // - int iNumCols = GAMESTATE->GetCurrentStyleDef()->m_iColsPerPlayer; - for( int bar=0; bar < iNumCols; bar++ ) + const int iNumCols = GAMESTATE->GetCurrentStyleDef()->m_iColsPerPlayer; + ASSERT_M( iNumCols < MAX_COLS_PER_PLAYER, ssprintf("%i >= %i", iNumCols, MAX_COLS_PER_PLAYER) ); + for( int col=0; col < iNumCols; ++col ) { - const StyleInput StyleI( m_PlayerNumber, bar ); + CHECKPOINT_M( ssprintf("%i %i", col, iNumCols) ); + const StyleInput StyleI( m_PlayerNumber, col ); const GameInput GameI = GAMESTATE->GetCurrentStyleDef()->StyleInputToGameInput( StyleI ); bool bIsHoldingButton = INPUTMAPPER->IsButtonDown( GameI ); // TODO: Make this work for non-human-controlled players if( bIsHoldingButton && !GAMESTATE->m_bDemonstrationOrJukebox && GAMESTATE->m_PlayerController[m_PlayerNumber]==PC_HUMAN ) - m_pNoteField->SetPressed(bar); + m_pNoteField->SetPressed( col ); } CHECKPOINT;