Remove trailing " [" from common substring when loading BMS files.

This commit is contained in:
Thai Pangsakulyanont
2011-03-23 09:59:39 +07:00
parent a044bf149e
commit aab30fbfa1
+12
View File
@@ -1104,6 +1104,18 @@ bool BMSLoader::LoadFromDir( const RString &sDir, Song &out )
map<RString,int> idToKeysoundIndex;
ReadGlobalTags( aBMSData[iMainDataIndex], out, sigAdjustments, idToKeysoundIndex );
// The brackets before the difficulty are in common substring, so remove them if it's found.
if( commonSubstring.size() > 2 && commonSubstring[commonSubstring.size() - 2] == ' ' )
{
switch( commonSubstring[commonSubstring.size() - 1] )
{
case '[':
case '(':
case '<':
commonSubstring = commonSubstring.substr(0, commonSubstring.size() - 2);
}
}
// Override what that global tag said about the title if we have a good substring.
// Prevents clobbering and catches "MySong (7keys)" / "MySong (Another) (7keys)"
// Also catches "MySong (7keys)" / "MySong (14keys)"