Skip to content

Commit 2a1f963

Browse files
authored
bugfix(filesystem): Prevent loading wrong INIZH.big from Data/INI directory to prevent INI CRC mismatch (#1879)
1 parent 963d7f7 commit 2a1f963

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

Core/GameEngineDevice/Source/StdDevice/Common/StdBIGFileSystem.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,16 @@ Bool StdBIGFileSystem::loadBigFilesFromDirectory(AsciiString dir, AsciiString fi
215215
Bool actuallyAdded = FALSE;
216216
FilenameListIter it = filenameList.begin();
217217
while (it != filenameList.end()) {
218+
#if RTS_ZEROHOUR
219+
// TheSuperHackers @bugfix bobtista 18/11/2025 Skip duplicate INIZH.big in Data\INI to prevent CRC mismatches.
220+
// English, Chinese, and Korean SKUs shipped with two INIZH.big files (one in Run directory, one in Run\Data\INI).
221+
// The DeleteFile cleanup doesn't work on EA App/Origin installs because the folder is not writable, so we skip loading it instead.
222+
if (it->endsWithNoCase("Data\\INI\\INIZH.big") || it->endsWithNoCase("Data/INI/INIZH.big")) {
223+
it++;
224+
continue;
225+
}
226+
#endif
227+
218228
ArchiveFile *archiveFile = openArchiveFile((*it).str());
219229

220230
if (archiveFile != NULL) {

Core/GameEngineDevice/Source/Win32Device/Common/Win32BIGFileSystem.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,16 @@ Bool Win32BIGFileSystem::loadBigFilesFromDirectory(AsciiString dir, AsciiString
216216
Bool actuallyAdded = FALSE;
217217
FilenameListIter it = filenameList.begin();
218218
while (it != filenameList.end()) {
219+
#if RTS_ZEROHOUR
220+
// TheSuperHackers @bugfix bobtista 18/11/2025 Skip duplicate INIZH.big in Data\INI to prevent CRC mismatches.
221+
// English, Chinese, and Korean SKUs shipped with two INIZH.big files (one in Run directory, one in Run\Data\INI).
222+
// The DeleteFile cleanup doesn't work on EA App/Origin installs because the folder is not writable, so we skip loading it instead.
223+
if (it->endsWithNoCase("Data\\INI\\INIZH.big") || it->endsWithNoCase("Data/INI/INIZH.big")) {
224+
it++;
225+
continue;
226+
}
227+
#endif
228+
219229
ArchiveFile *archiveFile = openArchiveFile((*it).str());
220230

221231
if (archiveFile != NULL) {

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -395,12 +395,6 @@ void GameEngine::init()
395395
// Create the low-level file system interface
396396
TheFileSystem = createFileSystem();
397397

398-
//Kris: Patch 1.01 - November 17, 2003
399-
//I was unable to resolve the RTPatch method of deleting a shipped file. English, Chinese, and Korean
400-
//SKU's shipped with two INIZH.big files. One properly in the Run directory and the other in Run\INI\Data.
401-
//We need to toast the latter in order for the game to patch properly.
402-
DeleteFile( "Data\\INI\\INIZH.big" );
403-
404398
// not part of the subsystem list, because it should normally never be reset!
405399
TheNameKeyGenerator = MSGNEW("GameEngineSubsystem") NameKeyGenerator;
406400
TheNameKeyGenerator->init();

0 commit comments

Comments
 (0)