Skip to content

Zero Hour rebuilt from EA's source: x64, Direct3D 11, VS2022/CMake, ~60 original bugs fixed, an AI that builds a base. Bring your own game.

fix(gameenginedevice): find the base game in a First Decade install

Olcay Seyganec1bce07a98a
diff --git a/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/Common/Win32BIGFileSystem.cpp b/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/Common/Win32BIGFileSystem.cpp
index 8943b3b29..ee1fb3d9f 100644
--- a/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/Common/Win32BIGFileSystem.cpp
+++ b/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/Common/Win32BIGFileSystem.cpp
@@ -54,12 +54,19 @@ static const char *const BASE_GAME_ARCHIVE = "Textures.big";
// Where to look when the registry does not say. Steam writes no key and installs the two games as
// sibling folders under steamapps\common (apps 2229870 and 2732960), so the base game is one folder
-// over; a copied-over install puts the same bigs in ZH_Generals next to the exe.
+// over; a copied-over install puts the same bigs in ZH_Generals next to the exe. The First Decade
+// does the same with its own folder name, and registers the collection's root folder as the base
+// game's InstallPath, so a player on v2.0.1 got "no base game archives" with Generals one folder
+// over.
static const char *const BASE_GAME_DIRECTORIES[] = {
"ZH_Generals\\",
"..\\Command & Conquer Generals\\",
+ "..\\Command & Conquer(tm) Generals\\",
};
+// The folder inside the First Decade's registered root that holds the base game.
+static const char FIRST_DECADE_GENERALS_FOLDER[] = "Command & Conquer(tm) Generals\\";
+
static Bool holdsBaseGameArchives(const char *directory)
{
AsciiString archive = directory;
@@ -138,6 +145,15 @@ void Win32BIGFileSystem::init() {
{
installPath.concat("\\");
}
+ if (!installPath.isEmpty() && !holdsBaseGameArchives(installPath.str()))
+ {
+ AsciiString firstDecade = installPath;
+ firstDecade.concat(FIRST_DECADE_GENERALS_FOLDER);
+ if (holdsBaseGameArchives(firstDecade.str()))
+ {
+ installPath = firstDecade;
+ }
+ }
// An uninstalled retail or First Decade copy leaves its key behind, and trusting it loaded
// no base archive at all: the water and the ground came up magenta and black on the shell map.
if (installPath.isEmpty() || !holdsBaseGameArchives(installPath.str()))