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.
C++ cmakecnccommand-and-conquercppdirectx11game-enginegame-preservationgeneralsrtssage-enginex64zero-hour
fix(gameengine): skip RemoveModule/ReplaceModule tags the data lacks
Olcay Seygan552cc099c7b5
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 5af650ed6..972fdeef6 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -1493,6 +1493,7 @@ The whole HUD is on the hardware. Four colours carry it, and they mean the same## Sound, video, and getting it to start at all- Audio is real, through the audio library the retail game ships with.+- Installs from outside Steam start again. Their copy of the game's data files differs from Steam's in a few places, and one of our fixes, to the Aurora's fuel-air bomb, looked for a piece that copy does not have and stopped the game at start with a parsing error. A fix that finds nothing to change now leaves that piece as it is and the game carries on.- A death cry plays to the end. So does "construction complete", and the tail of a gun. Telling a sound to stop used to cut it off that frame, where the 2003 game let it finish and only kept it from repeating; our own fix for the audio thread broke that, and it is put back. A looping sound caught in the pause between two plays can be stopped too, instead of carrying on after whatever made it is gone.- A sound on the right of the screen comes out of the right speaker. Since the game went 64-bit its sound library worked left and right out the wrong way round, so a tank firing off to the right was heard on the left. Only a sound well off to one side swings far enough to notice, which is why it seemed to come and go.- Your units answer you over the battle. A reply plays at whichever of the effects and voice sliders is higher, lifted again on top of that, so "Moving out" is heard in the middle of an artillery duel. Nothing else is turned down to make room for it. EVA and briefings stay where the voice slider puts them.diff --git a/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp b/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingTemplate.cppindex fb177347d..15a12bdd0 100644--- a/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp+++ b/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp@@ -768,12 +768,12 @@ void ThingTemplate::parseRemoveModule(INI *ini, void *instance, void *store, conconst char *modToRemove = ini->getNextToken();AsciiString removedModuleName;- Bool removed = self->removeModuleInfo(modToRemove, removedModuleName);- if (!removed)- {- DEBUG_ASSERTCRASH(removed, ("RemoveModule %s was not found for %s. The game will crash now!\n",modToRemove, self->getName().str()));- throw INI_INVALID_DATA;- }+ // A tag that is not there is already removed. Installs outside Steam carry other copies of EA's+ // data, and a missing tag in one of them stopped the game at start (FixesReforged.ini,+ // SupW_AuroraFuelAirBomb ModuleTag_03).+ if (!self->removeModuleInfo(modToRemove, removedModuleName))+ DEBUG_LOG(("[LINE: %d - FILE: '%s'] RemoveModule %s was not found for %s; skipped.\n",+ ini->getLineNum(), ini->getFilename().str(), modToRemove, self->getName().str()));self->m_moduleParsingMode = oldMode;}@@ -799,13 +799,10 @@ void ThingTemplate::parseReplaceModule(INI *ini, void *instance, void *store, coconst char *modToRemove = ini->getNextToken();AsciiString removedModuleName;- Bool removed = self->removeModuleInfo(modToRemove, removedModuleName);- if (!removed)- {- DEBUG_CRASH(("[LINE: %d - FILE: '%s'] ReplaceModule %s was not found for %s; cannot continue.\n",- ini->getLineNum(), ini->getFilename().str(), modToRemove, self->getName().str()));- throw INI_INVALID_DATA;- }+ // A missing tag means the new module is simply added, for the same installs RemoveModule skips for.+ if (!self->removeModuleInfo(modToRemove, removedModuleName))+ DEBUG_LOG(("[LINE: %d - FILE: '%s'] ReplaceModule %s was not found for %s; adding the new module.\n",+ ini->getLineNum(), ini->getFilename().str(), modToRemove, self->getName().str()));const Bool replacesAIModule = aiBefore != NULL && self->friend_getAIModuleInfo() == NULL;