From 3b3e8df2f41ece6bc4942dcf4e6d976f392e0eb1 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Fri, 10 Feb 2012 19:07:13 -0500 Subject: [PATCH] [editorKeysounds] Removing KS successful. --- src/ScreenEdit.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/ScreenEdit.cpp b/src/ScreenEdit.cpp index 3fa115b0af..f5177a8bca 100644 --- a/src/ScreenEdit.cpp +++ b/src/ScreenEdit.cpp @@ -3181,7 +3181,8 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM ) } else if (SM == SM_BackFromKeysoundTrack) { - int track = ScreenMiniMenu::s_iLastRowCode; + const int track = ScreenMiniMenu::s_iLastRowCode; + const int row = this->GetRow(); if (track < m_NoteDataEdit.GetNumTracks()) { @@ -3200,6 +3201,14 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM ) else // sound > kses.size() { // remove the sound. if it's an auto keysound, make it empty. + const TapNote &oldNote = m_NoteDataEdit.GetTapNote(track, row); + TapNote newNote = oldNote; + newNote.iKeysoundIndex = -1; + if (newNote.type == TapNote::autoKeysound) + { + newNote.type = TapNote::empty; // autoKeysound with no sound is pointless. + } + m_NoteDataEdit.SetTapNote(track, row, newNote); } } else