From 141ba141d0294393d0f780b9d514d79d0d6f7f47 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Wed, 31 Dec 2003 07:44:53 +0000 Subject: [PATCH] fix noteskin error if current game doesn't have a NoteSkin called "note" --- stepmania/src/NoteSkinManager.cpp | 1 + stepmania/src/ScreenEdit.cpp | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/stepmania/src/NoteSkinManager.cpp b/stepmania/src/NoteSkinManager.cpp index c02a57f09c..2a470414be 100644 --- a/stepmania/src/NoteSkinManager.cpp +++ b/stepmania/src/NoteSkinManager.cpp @@ -163,6 +163,7 @@ CString NoteSkinManager::GetMetric( CString sNoteSkinName, CString sButtonName, { sNoteSkinName.MakeLower(); CString sReturn; + ASSERT( m_mapNameToData.find(sNoteSkinName) != m_mapNameToData.end() ); // this NoteSkin doesn't exist! NoteSkinData& data = m_mapNameToData[sNoteSkinName]; if( data.metrics.GetValue( sButtonName, sValue, sReturn ) ) return sReturn; diff --git a/stepmania/src/ScreenEdit.cpp b/stepmania/src/ScreenEdit.cpp index e578a958ca..4fcf504ccc 100644 --- a/stepmania/src/ScreenEdit.cpp +++ b/stepmania/src/ScreenEdit.cpp @@ -297,7 +297,10 @@ ScreenEdit::ScreenEdit( CString sName ) : Screen( sName ) GAMESTATE->m_PlayerOptions[PLAYER_1].Init(); // don't allow weird options in editor. It doesn't handle reverse well. - GAMESTATE->m_PlayerOptions[PLAYER_1].m_sNoteSkin = "note"; // change noteskin back to default before loading player + // Set NoteSkin to note if available. + // Change noteskin back to default before loading player. + if( NOTESKIN->DoesNoteSkinExist("note") ) + GAMESTATE->m_PlayerOptions[PLAYER_1].m_sNoteSkin = "note"; GAMESTATE->ResetNoteSkins(); m_Player.Load( PLAYER_1, ¬eData, NULL, NULL, NULL, NULL, NULL, NULL, NULL );