Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit e5be676

Browse files
committed
Merge branch 'development'
2 parents 9dcb79f + 22c0ee4 commit e5be676

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

Menus/MainMenuGUI.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ namespace RTE {
114114
}
115115

116116
m_VersionLabel = dynamic_cast<GUILabel *>(m_MainMenuScreenGUIControlManager->GetControl("VersionLabel"));
117-
m_VersionLabel->SetText("Community Project\n" + std::string(c_GameVersion));
117+
m_VersionLabel->SetText("Community Project\n" + std::string(c_MajorGameVersion) + std::string(c_MinorGameVersion));
118118
m_VersionLabel->SetPositionAbs(10, g_WindowMan.GetResY() - m_VersionLabel->GetTextHeight() - 5);
119119
}
120120

System/Constants.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ namespace RTE {
1010
#pragma endregion
1111

1212
#pragma region Game Version
13-
static constexpr const char *c_GameVersion = "Pre-Release 5.0";
13+
static constexpr const char *c_MajorGameVersion = "Pre-Release 5";
14+
static constexpr const char *c_MinorGameVersion = ".1";
1415
#pragma endregion
1516

1617
#pragma region Userdata Constants

System/DataModule.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,13 @@ namespace RTE {
5252
if (reader.Create(indexPath, true, progressCallback) >= 0) {
5353
int result = Serializable::Create(reader);
5454

55-
if (m_ModuleID >= g_PresetMan.GetOfficialModuleCount() && !m_IsUserdata && m_SupportedGameVersion != c_GameVersion) {
56-
RTEAssert(!m_SupportedGameVersion.empty(), m_FileName + " does not specify a supported Cortex Command version, so it is not compatible with this version of Cortex Command (" + c_GameVersion + ").\nPlease contact the mod author or ask for help in the CCCP discord server.");
57-
RTEAbort(m_FileName + " supports Cortex Command version " + m_SupportedGameVersion + ", so it is not compatible with this version of Cortex Command (" + c_GameVersion + ").\nPlease contact the mod author or ask for help in the CCCP discord server.");
55+
size_t lastPeriodPosition = m_SupportedGameVersion.find_last_of(".");
56+
std::string supportedMajorGameVersion = m_SupportedGameVersion.substr(0, lastPeriodPosition);
57+
std::string supportedMinorGameVersion = lastPeriodPosition == std::string::npos ? ".0" : m_SupportedGameVersion.substr(lastPeriodPosition, m_SupportedGameVersion.length());
58+
if (m_ModuleID >= g_PresetMan.GetOfficialModuleCount() && !m_IsUserdata && (supportedMajorGameVersion != c_MajorGameVersion || supportedMinorGameVersion > c_MinorGameVersion)) {
59+
RTEAssert(!m_SupportedGameVersion.empty(), m_FileName + " does not specify a supported Cortex Command version, so it is not compatible with this version of Cortex Command (" + c_MajorGameVersion + c_MinorGameVersion + ").\nPlease contact the mod author or ask for help in the CCCP discord server.");
60+
RTEAssert(supportedMinorGameVersion <= c_MinorGameVersion, m_FileName + " supports Cortex Command version " + m_SupportedGameVersion + ", which is ahead of this version of Cortex Command (" + c_MajorGameVersion + c_MinorGameVersion + ").\nPlease update your game to the newest version to use this mod.");
61+
RTEAbort(m_FileName + " supports Cortex Command version " + m_SupportedGameVersion + ", so it is not compatible with this version of Cortex Command (" + c_MajorGameVersion + c_MinorGameVersion + ").\nPlease contact the mod author or ask for help in the CCCP discord server.");
5862
}
5963

6064
// Print an empty line to separate the end of a module from the beginning of the next one in the loading progress log.

0 commit comments

Comments
 (0)