From 6702f3cde7a89045c8443b864c66dc3944b79310 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 18 Dec 2002 08:26:56 +0000 Subject: [PATCH] add fix and check --- stepmania/src/NoteDataWithScoring.h | 4 ++++ stepmania/src/Player.cpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/stepmania/src/NoteDataWithScoring.h b/stepmania/src/NoteDataWithScoring.h index 9844d2bf9f..877290ac00 100644 --- a/stepmania/src/NoteDataWithScoring.h +++ b/stepmania/src/NoteDataWithScoring.h @@ -39,18 +39,22 @@ public: const TapNoteScore &GetTapNoteScore(int track, int row) const { + ASSERT(row < int(m_TapNoteScores[track].size())); return m_TapNoteScores[track][row]; } TapNoteScore &GetTapNoteScore(int track, int row) { + ASSERT(row < int(m_TapNoteScores[track].size())); return m_TapNoteScores[track][row]; } const HoldNoteScore &GetHoldNoteScore(int h) const { + ASSERT(h < int(m_HoldNoteScores.size())); return m_HoldNoteScores[h]; } HoldNoteScore &GetHoldNoteScore(int h) { + ASSERT(h < int(m_HoldNoteScores.size())); return m_HoldNoteScores[h]; } float &GetHoldNoteLife(int h) diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index c74428a57e..2adf68f99c 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -125,7 +125,7 @@ void Player::Load( PlayerNumber pn, NoteData* pNoteData, LifeMeter* pLM, ScoreDi const StyleDef* pStyleDef = GAMESTATE->GetCurrentStyleDef(); // init scoring - NoteDataWithScoring::Init(pNoteData->GetLastRow(), pNoteData->GetNumHoldNotes()); + NoteDataWithScoring::Init(pNoteData->GetLastRow()+1, pNoteData->GetNumHoldNotes()); // copy note data this->CopyAll( pNoteData );