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 the chem suit decal on a unit with no drawable
Olcay Seygana51754587609
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex a4706cb9d..14b8d1348 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -328,6 +328,7 @@ found and fixed, EA's own, not port damage.**- A network game or a replay on a map this machine cannot read goes back to the menu. It used to deal out the start positions as if the map had eight, while the machines that had it dealt over the map's own, and the game split from the first second.- A mod whose unit is switched on, held back or stripped by an upgrade the mod never defines no longer crashes the game as the map loads. The missing name is skipped and written to the log once, and the rest of the unit's upgrades work.- A mod or an install folder carrying an older skirmish room screen, one without the match record panel, no longer crashes the game on the way into Skirmish. The room opens without the record and plays as before.+- A unit that leaves the factory already a veteran with Chemical Suits on no longer crashes the game (a player hit it under a mod). The suits went on before the unit had a body on screen to mark; such a unit now goes without the ground marking under it.## One interfacediff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Upgrade/ArmorUpgrade.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Upgrade/ArmorUpgrade.cppindex 3a3085871..64bf7ad9d 100644--- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Upgrade/ArmorUpgrade.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Upgrade/ArmorUpgrade.cpp@@ -98,10 +98,11 @@ void ArmorUpgrade::upgradeImplementation( )body->setArmorSetFlag( ARMORSET_PLAYER_UPGRADE );// Unique case for AMERICA to test for upgrade to set flag- if(isTriggeredBy("Upgrade_AmericaChemicalSuits"))- {- obj->getDrawable()->setTerrainDecal(TERRAIN_DECAL_CHEMSUIT);- }+ // The Object constructor sets a unit's production veterancy, which runs the upgrades, before+ // initObject has made its drawable; that unit goes without the decal rather than crashing.+ Drawable *draw = obj->getDrawable();+ if( draw && isTriggeredBy("Upgrade_AmericaChemicalSuits") )+ draw->setTerrainDecal(TERRAIN_DECAL_CHEMSUIT);}// ------------------------------------------------------------------------------------------------