From 1afec64f3486290b7926cc5d58ce02e769c077d4 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Tue, 12 Aug 2003 07:48:35 +0000 Subject: [PATCH] fix Course::Save() writes incorrect song path --- stepmania/src/Course.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/stepmania/src/Course.cpp b/stepmania/src/Course.cpp index 7f385cc959..5709f9def9 100644 --- a/stepmania/src/Course.cpp +++ b/stepmania/src/Course.cpp @@ -316,7 +316,15 @@ void Course::Save() switch( entry.type ) { case COURSE_ENTRY_FIXED: - fprintf( fp, "#SONG:%s", entry.pSong->GetSongDir().c_str() ); + { + // strip off everything but the group name and song dir + CStringArray as; + split( entry.pSong->GetSongDir(), SLASH, as ); + ASSERT( !as.empty() ); + CString sGroup = as[ as.size()-2 ]; + CString sSong = as[ as.size()-1 ]; + fprintf( fp, "#SONG:" + sGroup + SLASH + sSong ); + } break; case COURSE_ENTRY_RANDOM: fprintf( fp, "#SONG:*" );