reading/writing fixes
This commit is contained in:
@@ -282,6 +282,7 @@ void Course::LoadFromCRSFile( CString sPath )
|
|||||||
}
|
}
|
||||||
|
|
||||||
new_entry.attacks = attacks;
|
new_entry.attacks = attacks;
|
||||||
|
attacks.clear();
|
||||||
|
|
||||||
m_entries.push_back( new_entry );
|
m_entries.push_back( new_entry );
|
||||||
}
|
}
|
||||||
@@ -320,6 +321,22 @@ void Course::Save()
|
|||||||
{
|
{
|
||||||
const CourseEntry& entry = m_entries[i];
|
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 )
|
switch( entry.type )
|
||||||
{
|
{
|
||||||
case COURSE_ENTRY_FIXED:
|
case COURSE_ENTRY_FIXED:
|
||||||
|
|||||||
Reference in New Issue
Block a user