Remove trailing " [" from common substring when loading BMS files.
This commit is contained in:
@@ -1104,6 +1104,18 @@ bool BMSLoader::LoadFromDir( const RString &sDir, Song &out )
|
|||||||
map<RString,int> idToKeysoundIndex;
|
map<RString,int> idToKeysoundIndex;
|
||||||
ReadGlobalTags( aBMSData[iMainDataIndex], out, sigAdjustments, 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.
|
// Override what that global tag said about the title if we have a good substring.
|
||||||
// Prevents clobbering and catches "MySong (7keys)" / "MySong (Another) (7keys)"
|
// Prevents clobbering and catches "MySong (7keys)" / "MySong (Another) (7keys)"
|
||||||
// Also catches "MySong (7keys)" / "MySong (14keys)"
|
// Also catches "MySong (7keys)" / "MySong (14keys)"
|
||||||
|
|||||||
Reference in New Issue
Block a user