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): a tunnel no player owns no longer crashes a target scan
Olcay Seygana53a8678c24c
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex ae07c343b..285aa952e 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -2058,6 +2058,7 @@ The whole HUD is on the hardware. Four colours carry it, and they mean the same## It does not crash+- A GLA tunnel that belongs to no player no longer crashes the game when a unit near it looks for a target. With no owner there is no tunnel network behind it, and the check for hidden men inside asked that missing network for its first passenger. Three crash reports from 3.5.1 came from it, two of them the same network match seen from both machines.- A sound cut off in the middle no longer takes the game down a moment later. The game stopped the sound and freed it, but Windows' audio mixer only stops reading on its next pass, a hundredth of a second on, and two players' games died with the mixer reading what had just been freed. Every sound now plays from a copy the mixer gives back itself when it is done. A load screen movie skipped to its last frame threw its sound away the same way, and now leaves it to the mixer too.- That copy did not end the mixer crash: two 3.3.0 players still met it. Each sound channel was reused for the next sound by stopping it, emptying it and handing it new audio, and now and then Windows' mixer carried its place in the old sound over as one step before the start of the new one, then read eight gigabytes past it. Every sound now gets a fresh channel that nothing has played before, which is how Windows' mixer is normally used.- The game no longer crashes now and then as a match starts or a new unit comes on the field. Since 3.2.0 the battle runs beside the picture, and both sides ask the game's files whether a model or a texture is there. The answers go into one shared list, and two answers written at once tore it, which took the game down later in some unrelated place. Two reads from the same game archive at once could also hand one of them the other's bytes. Each now waits its turn.diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/TunnelContain.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/TunnelContain.cppindex 90807cdc8..967bb64d4 100644--- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/TunnelContain.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/TunnelContain.cpp@@ -329,8 +329,10 @@ Bool TunnelContain::getContainerPipsToShow( Int& numTotal, Int& numFull )const ContainedItemsList* TunnelContain::getContainedItemsList() const{+ // No tracker (the neutral player has no tunnel system): nobody inside. Our own list is always empty+ // here, since addToContainList goes to the tracker, and half the callers walk this without a NULL check.TunnelTracker *tunnelTracker = getTunnelTracker();- return tunnelTracker ? tunnelTracker->getContainedItemsList() : NULL;+ return tunnelTracker ? tunnelTracker->getContainedItemsList() : OpenContain::getContainedItemsList();}//-------------------------------------------------------------------------------------------------diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cppindex 443e42f38..3c434de70 100644--- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp@@ -6308,8 +6308,8 @@ Bool PartitionFilterStealthedAndUndetected::allow( Object *objOther )if( contain ){const Player* victimApparentController = contain->getApparentControllingPlayer( m_obj->getControllingPlayer() );- //Check if it's stealthed!- if( contain->getStealthUnitsContained() == contain->getContainCount() )+ //Check if it's stealthed! An empty container is 0 == 0, and has no first object to look at.+ if( contain->getContainCount() > 0 && contain->getStealthUnitsContained() == contain->getContainCount() ){//Check if the first object inside is detected (if one is detected, all are detected).ContainedItemsList::const_iterator it = contain->getContainedItemsList()->begin();