diff --git a/src/Group.cpp b/src/Group.cpp index a32c312bdd..d61e050bc8 100644 --- a/src/Group.cpp +++ b/src/Group.cpp @@ -57,7 +57,7 @@ Group::Group(const RString& sDir, const RString& sGroupDirName, bool bFromProfil m_sSortTitle = m_sGroupName; m_sTranslitTitle = m_sGroupName; m_sSeries = ""; - m_fSyncOffset = PREFSMAN->m_DefaultSyncOffset == SyncOffset_NULL ? 0.0f : -0.009f; + m_fSyncOffset = 0.0f; m_bHasPackIni = false; m_iYearReleased = 0; m_sBannerPath = ""; @@ -102,13 +102,30 @@ Group::Group(const RString& sDir, const RString& sGroupDirName, bool bFromProfil RString sValue = ""; ini.GetValue("Group", "SyncOffset", sValue); Trim(sValue); + // Handle the group offset application. + // + // The goal of Pack.ini is to make everything NULL synced internally. + // + // The machine sync offset preference corresponds to what offset the user + // would like to assume as a "default" for packs without a Pack.ini. + // + // If the machine sync bias is set to ITG, we want to remove the 9ms ITG bias + // for all packs without a Pack.ini. + // + // If the Pack.ini is specified (regardless of the machine sync bias) with + // SyncOffset=ITG, we need to always remove the 9ms ITG bias. + // Otherwise, if SyncOffset=NULL, we don't need to do anything since it's + // already NULL synced. + m_fSyncOffset = (PREFSMAN->m_DefaultSyncOffset == SyncOffset_NULL) ? 0.0f : -0.009f; if (!sValue.empty()) { if (sValue == "NULL") { m_fSyncOffset = 0.0f; - } else if (sValue == "ITG") { + } + 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()); + } + else { + LOG->Warn("Group::Group: Invalid SyncOffset value: %s in Pack.ini. Valid values are NULL and ITG. Using default value.", sValue.c_str()); } } @@ -201,4 +218,4 @@ public: LUA_REGISTER_CLASS(Group) -// lua end \ No newline at end of file +// lua end