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.

feat(gameengine): raise the ceiling on how many upgrades can exist

Olcay Seygan9a08bbb6ed5f
diff --git a/GeneralsMD/Code/GameEngine/Include/Common/Upgrade.h b/GeneralsMD/Code/GameEngine/Include/Common/Upgrade.h
index a2218c7d1..f9dc98ec0 100644
--- a/GeneralsMD/Code/GameEngine/Include/Common/Upgrade.h
+++ b/GeneralsMD/Code/GameEngine/Include/Common/Upgrade.h
@@ -54,7 +54,10 @@ enum UpgradeStatusType
};
//The maximum number of upgrades.
-#define UPGRADE_MAX_COUNT 128
+// How many distinct upgrades the game may know about. A mod that adds its own runs into this, and
+// the failure is silent - the mask simply has no bit left for the new one. The mask is a bit
+// field, so raising it costs 48 bytes per player and per object that carries one.
+#define UPGRADE_MAX_COUNT 512
typedef BitFlags<UPGRADE_MAX_COUNT> UpgradeMaskType;