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.

560 B
Raw Blame
diff --git a/_lz.h b/_lz.h
--- a/_lz.h
+++ b/_lz.h
@@ -93,6 +93,11 @@
 inline LZBuffer::LZBuffer()
     {
     buf= new BYTE[ LZBUFSIZE ];
+    // Zero Hour Reforged: altered - the history starts cleared.  The backward match (Lz.cpp) compares
+    // positions not yet written, so without this the output depends on what the allocator left in the
+    // buffer, and the decompressor rebuilds from its own leftovers.  The game's operator new zero-fills,
+    // so these are the bytes it always saw.
+    memset( buf, 0, LZBUFSIZE );
     bufPos = 0;
     }