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(ww3d2): refuse a hierarchy with no pivots
Olcay Seygan13aee42c634f
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex d9f7991a0..100464624 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -725,6 +725,7 @@ found and fixed — EA's own, not port damage.**- The opening movies froze on their first frame with that picture on. A movie writes a new image every frame into a texture the copy had already taken.- Opening Single Player could take the game down a quarter of a second in, as the buttons flashed in. The menu's animation list names a Custom Mission button that only the 1.04 patch's main menu has, and on an install whose menu lacks it, every step of the flash skipped the missing button except one, which tried to draw it. That step skips it now too.- Two blocks of 2003 assembly destroyed registers and took down the main menu.+- A model file with no skeleton in it is refused as it loads. It used to load, and the game went down the first time anything asked it for a bone.- Quitting faulted twice every time; it now takes about half a second.- A long chat message or an unusual map name could kill the process.- A map name the game cannot make sense of is refused as you start, instead of taking the game down later. A path with a space in it and no quotes around it left the loader walking the same step of that path forever, growing a string until it ran out of room, and the game then went on starting with half of itself missing. What you saw was a crash a second later, in the part of the game that runs a match, naming nothing that had anything to do with it. Any failure during start-up now stops the game there and says which one it was.diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/htree.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/htree.cppindex 27be29c42..6ae169128 100644--- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/htree.cpp+++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/htree.cpp@@ -210,9 +210,11 @@ int HTreeClass::Load_W3D(ChunkLoadClass & cload)*/memcpy(Name,header.Name,W3D_NAME_LEN);NumPivots = header.NumPivots;- if (NumPivots > 0) {- Pivot = MSGW3DNEWARRAY("HTreeClass::Pivot") PivotClass[NumPivots];+ // A hierarchy with no pivots is a broken file: every lookup below indexes Pivot, which would stay NULL.+ if (NumPivots < 1) {+ return LOAD_ERROR;}+ Pivot = MSGW3DNEWARRAY("HTreeClass::Pivot") PivotClass[NumPivots];/*** Now, read in all of the other chunks for this hierarchy.