Skip to content

Commit 6d738b9

Browse files
committed
Fix version check skipped if property is not defined (followup to 6b01e00)
1 parent 89697bc commit 6d738b9

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

System/DataModule.cpp

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -494,25 +494,23 @@ namespace RTE {
494494
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
495495

496496
void DataModule::CheckSupportedGameVersion() const {
497-
if (*m_SupportedGameVersion != c_GameVersion) {
498-
static const std::string contactAuthor = "Please contact the mod author or ask for help in the CCCP discord server.";
497+
static const std::string contactAuthor = "Please contact the mod author or ask for help in the CCCP discord server.";
499498

500-
RTEAssert(*m_SupportedGameVersion != version::Semver200_version(), m_FileName + " does not specify a supported Cortex Command version, so it is not compatible with this version of Cortex Command (" + c_GameVersion.str() + ").\n\n" + contactAuthor);
499+
RTEAssert(m_SupportedGameVersion, m_FileName + " does not specify a supported Cortex Command version, so it is not compatible with this version of Cortex Command (" + c_GameVersion.str() + ").\n\n" + contactAuthor);
501500

502-
bool modulePrereleaseVersionMismatch = !m_SupportedGameVersion->prerelease().empty();
503-
bool moduleBuildVersionMismatch = !m_SupportedGameVersion->build().empty();
504-
RTEAssert(!modulePrereleaseVersionMismatch && !moduleBuildVersionMismatch, m_FileName + " was developed for pre-release build of Cortex Command v" + m_SupportedGameVersion->str() + ", this game version (v" + c_GameVersion.str() + ") is incompatible.\n\nMods developed on a pre-release must match the game version exactly.\n" + contactAuthor);
501+
bool modulePrereleaseVersionMismatch = !m_SupportedGameVersion->prerelease().empty();
502+
bool moduleBuildVersionMismatch = !m_SupportedGameVersion->build().empty();
503+
RTEAssert(!modulePrereleaseVersionMismatch && !moduleBuildVersionMismatch, m_FileName + " was developed for pre-release build of Cortex Command v" + m_SupportedGameVersion->str() + ", this game version (v" + c_GameVersion.str() + ") is incompatible.\n\nMods developed on a pre-release must match the game version exactly.\n" + contactAuthor);
505504

506-
bool gamePrereleaseVersionMismatch = !c_GameVersion.prerelease().empty();
507-
bool gameBuildVersionMismatch = !c_GameVersion.build().empty();
508-
RTEAssert(!gamePrereleaseVersionMismatch && !gameBuildVersionMismatch, m_FileName + " was developed for Cortex Command v" + m_SupportedGameVersion->str() + ", this pre-release version of the game (v" + c_GameVersion.str() + ") may not support it.\n\nMods must match the game version exactly to use pre-release builds.\n" + contactAuthor);
505+
bool gamePrereleaseVersionMismatch = !c_GameVersion.prerelease().empty();
506+
bool gameBuildVersionMismatch = !c_GameVersion.build().empty();
507+
RTEAssert(!gamePrereleaseVersionMismatch && !gameBuildVersionMismatch, m_FileName + " was developed for Cortex Command v" + m_SupportedGameVersion->str() + ", this pre-release version of the game (v" + c_GameVersion.str() + ") may not support it.\n\nMods must match the game version exactly to use pre-release builds.\n" + contactAuthor);
509508

510-
// Game engine is the same major version as the Module
511-
bool majorVersionMatch = c_GameVersion.major() == m_SupportedGameVersion->major();
512-
// Game engine is at least the minor version the Module requires (allow patch mismatch)
513-
bool minorVersionInRange = m_SupportedGameVersion->inc_minor() <= c_GameVersion.inc_minor();
509+
// Game engine is the same major version as the Module
510+
bool majorVersionMatch = c_GameVersion.major() == m_SupportedGameVersion->major();
511+
// Game engine is at least the minor version the Module requires (allow patch mismatch)
512+
bool minorVersionInRange = m_SupportedGameVersion->inc_minor() <= c_GameVersion.inc_minor();
514513

515-
RTEAssert(majorVersionMatch && minorVersionInRange, m_FileName + " was developed for Cortex Command v" + m_SupportedGameVersion->str() + ", so this version of Cortex Command (v" + c_GameVersion.str() + ") may not support it.\n" + contactAuthor);
516-
}
514+
RTEAssert(majorVersionMatch && minorVersionInRange, m_FileName + " was developed for Cortex Command v" + m_SupportedGameVersion->str() + ", so this version of Cortex Command (v" + c_GameVersion.str() + ") may not support it.\n" + contactAuthor);
517515
}
518516
}

0 commit comments

Comments
 (0)