Explicitly require and use capital NULL and ITG everywhere for sync bias, comment fix, nullptr check for group
This commit is contained in:
+6
-5
@@ -36,8 +36,9 @@ Group::Group() {
|
||||
m_sBannerPath = "";
|
||||
}
|
||||
|
||||
Group::~Group() {
|
||||
SONGMAN->GetGroupGroupMap().erase(m_sGroupName);
|
||||
Group::~Group()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Group::Group(const RString& sDir, const RString& sGroupDirName) {
|
||||
@@ -63,7 +64,7 @@ Group::Group(const RString& sDir, const RString& sGroupDirName) {
|
||||
Trim(sVersion);
|
||||
|
||||
// Only read the Pack.ini if the version is set
|
||||
// Otherwise log a warning and skip reading the
|
||||
// Otherwise log a warning and use default Pack.ini values
|
||||
if (!sVersion.empty()) {
|
||||
m_bHasPackIni = true;
|
||||
m_iVersion = StringToInt(sVersion);
|
||||
@@ -94,9 +95,9 @@ Group::Group(const RString& sDir, const RString& sGroupDirName) {
|
||||
ini.GetValue("Group", "SyncOffset", sValue);
|
||||
Trim(sValue);
|
||||
if (!sValue.empty()) {
|
||||
if (sValue.CompareNoCase("null") == 0) {
|
||||
if (sValue == "NULL") {
|
||||
m_fSyncOffset = 0.0f;
|
||||
} else if (sValue.CompareNoCase("itg") == 0) {
|
||||
} else if (sValue == "ITG") {
|
||||
m_fSyncOffset = -0.009f;
|
||||
} else {
|
||||
LOG->Warn("Group::Group: Invalid SyncOffset value: %s in Pack.ini. Valid values are NULL and ITG. Defaulting to NULL.", sValue.c_str());
|
||||
|
||||
@@ -947,7 +947,7 @@ static void InitializeConfOptions()
|
||||
c.AddOption( ssprintf("%+i ms", i) );
|
||||
ADD( c );
|
||||
}
|
||||
ADD( ConfOption( "MachineSyncBias", MachineSyncBias, "Null","|ITG" ) );
|
||||
ADD( ConfOption( "MachineSyncBias", MachineSyncBias, "NULL","|ITG" ) );
|
||||
ADD( ConfOption( "EnableAttackSounds", MovePref<bool>, "No","Yes" ) );
|
||||
ADD( ConfOption( "EnableMineHitSound", MovePref<bool>, "No","Yes" ) );
|
||||
ADD( ConfOption( "RateModPreservesPitch", MovePref<bool>, "No","Yes") );
|
||||
|
||||
@@ -279,6 +279,12 @@ void SongManager::AddGroup( RString sDir, RString sGroupDirName, Group* group )
|
||||
if( j != m_sSongGroupNames.size() )
|
||||
return; // the group is already added
|
||||
|
||||
if ( group == nullptr ) {
|
||||
// Could not AddGroup 'sGroupDirName'. Group object is null.
|
||||
LuaHelpers::ReportScriptErrorFmt("Could not AddGroup '%s'. Group object is null.", sGroupDirName.c_str() );
|
||||
return;
|
||||
}
|
||||
|
||||
RString sBannerPath;
|
||||
|
||||
// Look for a group banner in this group folder
|
||||
|
||||
Reference in New Issue
Block a user