Explicitly require and use capital NULL and ITG everywhere for sync bias, comment fix, nullptr check for group

This commit is contained in:
Crash Cringle
2025-03-03 23:25:32 -08:00
committed by teejusb
parent 35570a0880
commit dbbcc57112
3 changed files with 13 additions and 6 deletions
+6 -5
View File
@@ -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());
+1 -1
View File
@@ -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") );
+6
View File
@@ -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