fix Course::Save() writes incorrect song path

This commit is contained in:
Chris Danford
2003-08-12 07:48:35 +00:00
parent a1b15435b1
commit 1afec64f34
+9 -1
View File
@@ -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:*" );