Skip to content

Commit 5b5a973

Browse files
authored
bugfix(gui): Fix incorrect Replay incompatibility messages (#1745)
1 parent 10f130a commit 5b5a973

File tree

4 files changed

+22
-34
lines changed

4 files changed

+22
-34
lines changed

Generals/Code/GameEngine/Source/Common/Recorder.cpp

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,18 +1170,16 @@ Bool RecorderClass::replayMatchesGameVersion(AsciiString filename)
11701170

11711171
Bool RecorderClass::replayMatchesGameVersion(const ReplayHeader& header)
11721172
{
1173-
Bool versionStringDiff = header.versionString != TheVersion->getUnicodeVersion();
1174-
Bool versionTimeStringDiff = header.versionTimeString != TheVersion->getUnicodeBuildTime();
1175-
Bool versionNumberDiff = header.versionNumber != TheVersion->getVersionNumber();
1176-
Bool exeCRCDiff = header.exeCRC != TheGlobalData->m_exeCRC;
1177-
Bool exeDifferent = versionStringDiff || versionTimeStringDiff || versionNumberDiff || exeCRCDiff;
1178-
Bool iniDifferent = header.iniCRC != TheGlobalData->m_iniCRC;
1179-
1180-
if(exeDifferent || iniDifferent)
1181-
{
1182-
return FALSE;
1183-
}
1184-
return TRUE;
1173+
// TheSuperHackers @fix No longer checks the build time here to prevent incorrect Replay playback incompatibility messages when the Replay playback would actually be technically compatible.
1174+
if (header.versionString != TheVersion->getUnicodeVersion())
1175+
return false;
1176+
if (header.versionNumber != TheVersion->getVersionNumber())
1177+
return false;
1178+
if (header.exeCRC != TheGlobalData->m_exeCRC)
1179+
return false;
1180+
if (header.iniCRC != TheGlobalData->m_iniCRC)
1181+
return false;
1182+
return true;
11851183
}
11861184

11871185
/**

Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ReplayMenu.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -312,11 +312,7 @@ void PopulateReplayFileListbox(GameWindow *listbox)
312312

313313
const Bool hasMap = mapData != NULL;
314314

315-
const Bool isCrcCompatible =
316-
header.versionString == TheVersion->getUnicodeVersion()
317-
&& header.versionNumber == TheVersion->getVersionNumber()
318-
&& header.exeCRC == TheGlobalData->m_exeCRC
319-
&& header.iniCRC == TheGlobalData->m_iniCRC;
315+
const Bool isCrcCompatible = RecorderClass::replayMatchesGameVersion(header);
320316

321317
if (isCrcCompatible)
322318
{

GeneralsMD/Code/GameEngine/Source/Common/Recorder.cpp

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,18 +1173,16 @@ Bool RecorderClass::replayMatchesGameVersion(AsciiString filename)
11731173

11741174
Bool RecorderClass::replayMatchesGameVersion(const ReplayHeader& header)
11751175
{
1176-
Bool versionStringDiff = header.versionString != TheVersion->getUnicodeVersion();
1177-
Bool versionTimeStringDiff = header.versionTimeString != TheVersion->getUnicodeBuildTime();
1178-
Bool versionNumberDiff = header.versionNumber != TheVersion->getVersionNumber();
1179-
Bool exeCRCDiff = header.exeCRC != TheGlobalData->m_exeCRC;
1180-
Bool exeDifferent = versionStringDiff || versionTimeStringDiff || versionNumberDiff || exeCRCDiff;
1181-
Bool iniDifferent = header.iniCRC != TheGlobalData->m_iniCRC;
1182-
1183-
if(exeDifferent || iniDifferent)
1184-
{
1185-
return FALSE;
1186-
}
1187-
return TRUE;
1176+
// TheSuperHackers @fix No longer checks the build time here to prevent incorrect Replay playback incompatibility messages when the Replay playback would actually be technically compatible.
1177+
if (header.versionString != TheVersion->getUnicodeVersion())
1178+
return false;
1179+
if (header.versionNumber != TheVersion->getVersionNumber())
1180+
return false;
1181+
if (header.exeCRC != TheGlobalData->m_exeCRC)
1182+
return false;
1183+
if (header.iniCRC != TheGlobalData->m_iniCRC)
1184+
return false;
1185+
return true;
11881186
}
11891187

11901188
/**

GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ReplayMenu.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -312,11 +312,7 @@ void PopulateReplayFileListbox(GameWindow *listbox)
312312

313313
const Bool hasMap = mapData != NULL;
314314

315-
const Bool isCrcCompatible =
316-
header.versionString == TheVersion->getUnicodeVersion()
317-
&& header.versionNumber == TheVersion->getVersionNumber()
318-
&& header.exeCRC == TheGlobalData->m_exeCRC
319-
&& header.iniCRC == TheGlobalData->m_iniCRC;
315+
const Bool isCrcCompatible = RecorderClass::replayMatchesGameVersion(header);
320316

321317
if (isCrcCompatible)
322318
{

0 commit comments

Comments
 (0)