diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index b2a211ad32..a3478b5fe6 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -447,6 +447,9 @@ bool Song::LoadSongInfoFromDWIFile( CString sPath ) CStringArray arrayValueTokens; split( sValueString, ":", arrayValueTokens ); + if( arrayValueTokens.GetSize() == 0 ) + continue; + CString sValueName = arrayValueTokens.GetAt( 0 ); sValueName.TrimLeft(); diff --git a/stepmania/src/smpackage/smpackage.cpp b/stepmania/src/smpackage/smpackage.cpp index c6cb30c7d3..3110467f61 100644 --- a/stepmania/src/smpackage/smpackage.cpp +++ b/stepmania/src/smpackage/smpackage.cpp @@ -58,25 +58,23 @@ BOOL CSmpackageApp::InitInstance() // Make sure the current directory is the root program directory + + // change dir to path of the execuctable + TCHAR szFullAppPath[MAX_PATH]; + GetModuleFileName(NULL, szFullAppPath, MAX_PATH); + + // strip off executable name + LPSTR pLastBackslash = strrchr(szFullAppPath, '\\'); + *pLastBackslash = '\0'; // terminate the string + + SetCurrentDirectory(szFullAppPath); + if( !DoesFileExist("Songs") ) { - // change dir to path of the execuctable - TCHAR szFullAppPath[MAX_PATH]; - GetModuleFileName(NULL, szFullAppPath, MAX_PATH); - - // strip off executable name - LPSTR pLastBackslash = strrchr(szFullAppPath, '\\'); - *pLastBackslash = '\0'; // terminate the string - - SetCurrentDirectory(szFullAppPath); - - if( !DoesFileExist("Songs") ) - { - AfxMessageBox( "Your Songs folder could not be located. Be sure 'smpackage.exe' is in your Stepmania installation folder.", MB_ICONSTOP ); - exit( 1 ); - } - + AfxMessageBox( "Your Songs folder could not be located. Be sure 'smpackage.exe' is in your Stepmania installation folder.", MB_ICONSTOP ); + exit( 1 ); } + // check if there's a .smzip command line argument CStringArray arrayCommandLineBits;