From a77521c2b6d8a1aec1a91fcf269f875f491240b5 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 26 Oct 2003 03:17:45 +0000 Subject: [PATCH] reading/writing fixes --- stepmania/src/Course.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/stepmania/src/Course.cpp b/stepmania/src/Course.cpp index b026e49ac6..1dc1450772 100644 --- a/stepmania/src/Course.cpp +++ b/stepmania/src/Course.cpp @@ -282,6 +282,7 @@ void Course::LoadFromCRSFile( CString sPath ) } new_entry.attacks = attacks; + attacks.clear(); m_entries.push_back( new_entry ); } @@ -320,6 +321,22 @@ void Course::Save() { const CourseEntry& entry = m_entries[i]; + for( unsigned j = 0; j < entry.attacks.size(); ++j ) + { + if( j == 0 ) + fprintf( fp, "#MODS:\n" ); + + const Attack &a = entry.attacks[j]; + fprintf( fp, " TIME=%.2f:LEN=%.2f:MODS=%s", + a.fStartSecond, a.fSecsRemaining, a.sModifier.c_str() ); + + if( j+1 < entry.attacks.size() ) + fprintf( fp, ":" ); + else + fprintf( fp, ";" ); + fprintf( fp, "\n" ); + } + switch( entry.type ) { case COURSE_ENTRY_FIXED: